ntk 8.29.1 → 8.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/text/fontmanager.js +7 -13
- package/package.json +1 -1
package/lib/text/fontmanager.js
CHANGED
|
@@ -460,16 +460,18 @@ export default class FontManager {
|
|
|
460
460
|
/**
|
|
461
461
|
* Find a font that has a glyph for `codepoint`, for use when the primary
|
|
462
462
|
* font doesn't. The registered faces of the families the style names
|
|
463
|
-
* first, in the order it names them, then
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* system covers the codepoint.
|
|
463
|
+
* first, in the order it names them, then the source's fallback chain
|
|
464
|
+
* (filtered by the source's coverage data — font files are only opened to
|
|
465
|
+
* confirm). Returns null when nothing on the system covers the codepoint.
|
|
467
466
|
*
|
|
468
467
|
* The families first because that is what a list of them is for: CSS's
|
|
469
468
|
* `font-family: Icons, Arial` sets a letter the icon face lacks in Arial,
|
|
470
469
|
* as a browser does. Walking every registered face instead gave it to
|
|
471
470
|
* whichever was registered first — an app's serif — however far down the
|
|
472
|
-
* list, or off it, that face was.
|
|
471
|
+
* list, or off it, that face was. Nor does a registered face the list does
|
|
472
|
+
* not name stand in for the source's: a face one document registers (a web
|
|
473
|
+
* font) would otherwise supply glyphs to every later document's text, and
|
|
474
|
+
* to text in no family of the app's at all.
|
|
473
475
|
*
|
|
474
476
|
* "Nothing covers it" includes "this environment has no system fonts at
|
|
475
477
|
* all". An app that loaded its own faces still reaches here for the first
|
|
@@ -499,14 +501,6 @@ export default class FontManager {
|
|
|
499
501
|
}
|
|
500
502
|
}
|
|
501
503
|
}
|
|
502
|
-
if (!found) {
|
|
503
|
-
for (const r of this._registered) {
|
|
504
|
-
if (r.font.hasGlyph(codepoint)) {
|
|
505
|
-
found = r.font;
|
|
506
|
-
break;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
504
|
if (!found) {
|
|
511
505
|
const source = this.source;
|
|
512
506
|
let candidates;
|