字形

wijmo.css 文件包含几个定义为纯CSS的字形。 字形由Wijmo控件和扩展使用,您的应用程序也可以使用它们.

使用CSS定义字形替代应用程序使用额外的字体或图像资源文件的需要,并确保使用当前主题定义的前景颜色和字体尺寸来渲染图像.

要在应用程序中使用Wijmo字形,请将span元素添加到标记中,并将其类设置为字形名称. 例如:

您可以使用CSS自定义Wijmo控件中使用的字形的外观。 例如,您可以使用下面的CSS隐藏或修改 FlexGrid 使用的铅笔字形的外观,以指示编辑模式下的行 :

/* hide the pencil glyph in FlexGrid controls */ .wj-flexgrid .wj-glyph-pencil { display: none; }

/* replace the pencil glyph in FlexGrid controls with a custom image */ .wj-flexgrid .wj-glyph-pencil { background-image:url('../images/my-pencil.png'); background-repeat: round; border: 0; opacity: 1; } .wj-flexgrid .wj-glyph-pencil:after { display: none; }

下表显示了 wijmo.css 文件中定义的字形:

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { let glyphs = ['asterisk', 'calendar', 'check', 'circle', 'clock', 'diamond', 'down', 'down-left', 'down-right', 'file', 'filter', 'left', 'minus', 'pencil', 'plus', 'right', 'square', 'step-backward', 'step-forward', 'up', 'up-left', 'up-right']; // let rowTemplate = '<tr>' + '<td>{glyph}</td>' + '<td style="font-size:125%;"><span class="wj-glyph-{glyph}"></span></td>' + '<td><code>&lt;span class="wj-glyph-{glyph}"&gt;&lt;/span&gt;</code></td>' + '</tr>'; // let tBody = ''; glyphs.forEach(item => { tBody += rowTemplate.replace(/\{glyph\}/g, item); }); // document.querySelector('tbody').innerHTML = tBody; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Glyphs</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div class="container-fluid"> <table class="table table-condensed"> <thead> <tr> <th>Name</th> <th>Glyph</th> <th>Markup</th> </tr> </thead> <tbody> </tbody> </table> </div> </body> </html> import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; // import { Component, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { glyphs = ['asterisk', 'calendar', 'check', 'circle', 'clock', 'diamond', 'down', 'down-left', 'down-right', 'file', 'filter', 'left', 'minus', 'pencil', 'plus', 'right', 'square', 'step-backward', 'step-forward', 'up', 'up-left', 'up-right']; } // @NgModule({ imports: [BrowserModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } // enableProdMode(); // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Glyphs</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component'); }); </script> </head> <body> <app-component></app-component> </body> </html> <div class="container-fluid"> <table class="table table-condensed"> <thead> <tr> <th>Name</th> <th>Glyph</th> <th>Markup</th> </tr> </thead> <tbody> <tr *ngFor="let glyph of glyphs"> <td>{{glyph}}</td> <td style="font-size:125%;"> <span class="wj-glyph-{{glyph}}"></span> </td> <td> <code>&lt;span class="wj-glyph-{{glyph}}"&gt;&lt;/span&gt;</code> </td> </tr> </tbody> </table> </div> <template> <div class="container-fluid"> <table class="table table-condensed"> <thead> <tr> <th>Name</th> <th>Glyph</th> <th>Markup</th> </tr> </thead> <tbody> <tr v-for="(glyph,index) in glyphs" v-bind:key="index"> <td>{{glyph}}</td> <td style="font-size:125%;"> <span v-bind:class="'wj-glyph-'+glyph"></span> </td> <td> <code>&lt;span class="wj-glyph-{{glyph}}"&gt;&lt;/span&gt;</code> </td> </tr> </tbody> </table> </div> </template> <script> import "bootstrap.css"; import "@grapecity/wijmo.styles/wijmo.css"; import Vue from "vue"; import * as wijmo from "@grapecity/wijmo"; let App = Vue.extend({ name: "app", data: function() { return { glyphs: [ "asterisk", "calendar", "check", "circle", "clock", "diamond", "down", "down-left", "down-right", "file", "filter", "left", "minus", "pencil", "plus", "right", "square", "step-backward", "step-forward", "up", "up-left", "up-right" ] }; } }); new Vue({ render: h => h(App) }).$mount("#app"); </script> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Glyphs</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app.vue'); </script> </head> <body> <div id="app"> </div> </body> </html> import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; class App extends React.Component { constructor(props) { super(props); this.state = { glyphs: [ "asterisk", "calendar", "check", "circle", "clock", "diamond", "down", "down-left", "down-right", "file", "filter", "left", "minus", "pencil", "plus", "right", "square", "step-backward", "step-forward", "up", "up-left", "up-right" ] }; } ; render() { return <div className="container-fluid"> <table className="table table-condensed"> <thead> <tr> <th>Name</th> <th>Glyph</th> <th>Markup</th> </tr> </thead> <tbody> {this.state.glyphs.map(function (glyph, index) { return <tr> <td> {glyph} </td> <td style={{ fontSize: "125%" }}> <span className={'wj-glyph-' + glyph}></span> </td> <td> <code>&lt;span class="wj-glyph-{glyph}"&gt;&lt;/span&gt;</code> </td> </tr>; })} </tbody> </table> </div>; } } ReactDOM.render(<App />, document.getElementById('app')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AutoComplete</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div id="app"></div> </body> </html>