mirror of
https://github.com/dolanmiu/docx.git
synced 2026-11-30 16:47:55 +01:00
feat(layout): measure, kern and join letters in Office's fonts that Word installs, as Word does (#3683)
* feat(layout): measure, kern and join letters in Office's fonts that Word installs, as Word does Adds Calibri Light, Aptos, Aptos Narrow, Trebuchet MS, Georgia, Verdana, Tahoma, Century Gothic, Consolas, Candara, Corbel, Constantia, Book Antiqua, Franklin Gothic Book, Gill Sans MT and Impact to the width tables, with their line heights, kerning and ligatures, from Word's PDFs of lay-stops2's font probes and Word's own files of the fonts. An italic Word slants is measured as upright; a bold Word makes itself still stops. Text with ligatures isn't kerned in faces whose kerning is only in their kern table, as Word leaves it. * docs(layout): say which ligatures Office's fonts join, and with which settings * fix(layout): name each made-bold probe line's font, so the reader reads each font's own The three fonts' MB1 lines had the same names, so word-stops-office-fonts.py read Calibri Light's under Franklin Gothic Book and Impact too. Each line now names its font, and the spaced H's are three from 48 points, so the line fits beside its longer label. * docs(layout): list the font probes in stops2's README
This commit is contained in:
@@ -192,7 +192,7 @@ A blank page that Word adds so a section starts on an odd or even page has nothi
|
||||
|
||||
## What it follows
|
||||
|
||||
The pages are laid out with the widths and heights of the characters of the fonts Word documents use most: Calibri, Cambria, Arial, Times New Roman and Courier New, and the heights of the lines of the Chinese, Japanese and Korean fonts Office has, and how far each goes below its baseline, such as MS Mincho, Yu Gothic, SimSun, Microsoft YaHei, PMingLiU and Malgun Gothic. The widths are those of the letters of Western and Central European languages, Turkish, Vietnamese, Greek and Cyrillic, of punctuation and the spaces other than U+0020, and of currency signs, arrows and mathematical symbols, as Word draws them in each font, plain, bold, italic and bold italic. It follows:
|
||||
The pages are laid out with the widths and heights of the characters of the fonts Word documents use most: Calibri, Cambria, Arial, Times New Roman and Courier New, and of Office's other fonts that Word installs: Calibri Light, Aptos, Aptos Narrow, Trebuchet MS, Georgia, Verdana, Tahoma, Century Gothic, Consolas, Candara, Corbel, Constantia, Book Antiqua, Franklin Gothic Book, Gill Sans MT and Impact; and the heights of the lines of the Chinese, Japanese and Korean fonts Office has, and how far each goes below its baseline, such as MS Mincho, Yu Gothic, SimSun, Microsoft YaHei, PMingLiU and Malgun Gothic. The widths are those of the letters of Western and Central European languages, Turkish, Vietnamese, Greek and Cyrillic, of punctuation and the spaces other than U+0020, and of currency signs, arrows and mathematical symbols, as Word draws them in each font, plain, bold, italic and bold italic. Italic text in a font without an italic face, such as Tahoma or Impact, is as wide as the upright text, as Word slants it, and Word draws Trebuchet MS bold italic as its bold, slanted. It follows:
|
||||
|
||||
- the document's styles, and each paragraph's and run's own formatting: fonts, sizes, bold, italics, kerning and ligatures (see [Kerning and ligatures](#kerning-and-ligatures)), capitals, and hidden text. A paragraph whose mark is hidden (`run: { vanish: true }`) is joined to the next, on its lines, as Word joins it, in its own alignment, left indent and space before, and the next one's space after. Where both are in a list, the next one's number is counted but not shown, so the paragraph after them has the number after it. One with no paragraph after it, before a table or at the end of a table cell or of the document, stays as it is. A paragraph with nothing shown whose mark is hidden, such as one of a hidden style, takes no room, whatever its formatting, as in Word: before another paragraph or a table, and at the end of the document, but for one at the end of a table cell, which is a line of its own. The paragraph after it keeps its own formatting, one in a list takes a number, its fields are counted where it is, and its bookmarks start with what is after it. The paragraphs around it go by its style for their contextual spacing. A page break or picture in hidden text takes no room either. Chinese, Japanese and Korean are in the run's East Asian font (`font: { eastAsia }`), or in MS Mincho when that font has none of their characters, as Word draws them. A right-to-left run (`rightToLeft`) is in the run's font, size, bold and italics for complex scripts (`font: { cs }`, `sizeComplexScript`, `boldComplexScript`, `italicsComplexScript`), as Word draws it
|
||||
- lengths given with units, such as `margin: { top: "1in" }`, `size: "12pt"` or a table's `width: { size: "6in", type: WidthType.DXA }`, as well as those given in numbers. Word reads each as a whole number of twips: rounded down from inches, points and picas, and to the nearest from centimeters and millimeters, and a size in points rounded down to a half-point, so `size: "10.75pt"` is 10.5 points. It reads the minus sign of a negative length as the whole number's only, and adds the fraction: `"-10.7pt"` is -9.3 points
|
||||
@@ -246,9 +246,9 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
|
||||
- a table row kept with the next before a row that then moves to the next page whole, such as one of a height that doesn't fit
|
||||
- a table whose rows give a column different widths, when its width is a share of the page, it has space between its cells, or a row starts past its first column; a table given no widths of more than 63 columns, more than Word allows; and a word longer than a table with no width of its own in twips can make room for, which Word breaks in a way not yet followed
|
||||
- a long word in a cell merged across columns, which Word makes room for in a way not yet followed: a word longer than those columns' longest words together, but not their longest lines, when a table given no widths is narrowed to fit, a word longer than their longest lines with more text beside it in a table given no widths, and one whose share would leave a column narrower than its longest line or its width
|
||||
- text in a font that isn't in the width tables, isn't given as a file (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) and isn't embedded in the document, such as Aptos, Georgia or Calibri Light, so its lines may not be where Word puts them: Word draws it with the font's own widths, or in another font when it doesn't have it, such as Cambria on the Mac. Bold text in a font given or embedded without a bold face stops too, as Word makes the bold face itself
|
||||
- kerning and ligatures Word's PDFs haven't shown (see [Kerning and ligatures](#kerning-and-ligatures)): kerned text in a font whose kerning isn't known, such as Carlito or an East Asian font that isn't monospaced, or with a character outside Windows-1252, such as Greek or Cyrillic, or one that takes no room, such as a zero-width space or a combining mark; kerned Cambria before a hyphen, en dash, no-break space, ™, backslash or à; Times New Roman's discretional ligatures, kerned, beside some characters; ligatures in a font whose ligatures aren't known, of a setting Word's Font dialog doesn't write, in regular Cambria, or beside a character outside Windows-1252; kerning and ligatures across a soft hyphen, and kerned text before one in its font, with which the hyphen Word draws at the end of a line may be kerned; a word longer than its line, kerned or with ligatures, as where Word breaks it hasn't been seen; text kerned or with ligatures on a document grid of characters; and in a font's file, substitutions other than ligatures in the setting's features, such as contextual ones. Text with OpenType number forms or spacing, stylistic sets or contextual alternates (`w14:numForm`, `w14:numSpacing`, `w14:stylisticSets`, `w14:cntxtAlts`) stops too, as their widths aren't known
|
||||
- a character whose width in its font isn't known, so its line may not be where Word puts it: a letter or symbol its font doesn't have, or its font's file has no glyph for, which Word draws in another font, such as most mathematical symbols in Calibri, Arial and Courier New, which Word draws in Cambria Math; a few that Word drew in a way their widths can't be read from, such as Ž and Ё in Courier New; and a symbol font's own symbol, such as Wingdings' tick (`SymbolRun`), or a symbol whose character isn't four hexadecimal digits
|
||||
- text in a font that isn't in the width tables, isn't given as a file (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) and isn't embedded in the document, such as Garamond, Segoe UI or Roboto, so its lines may not be where Word puts them: Word draws it with the font's own widths, or in another font when it doesn't have it, such as Cambria on the Mac. Bold text in a font given or embedded without a bold face stops too, as Word makes the bold face itself, and so does bold text in the fonts of the tables that have none, Calibri Light, Franklin Gothic Book and Impact: Word draws each character 18 thousandths of an em wider than the regular at 10 points, and other sizes haven't been seen
|
||||
- kerning and ligatures Word's PDFs haven't shown (see [Kerning and ligatures](#kerning-and-ligatures)): kerned text in a font whose kerning isn't known, such as Carlito or an East Asian font that isn't monospaced, or with a character outside Windows-1252, such as Greek or Cyrillic, or one that takes no room, such as a zero-width space or a combining mark; kerned Cambria before a hyphen, en dash, no-break space, ™, backslash or à; kerned text with ligatures other than standard and contextual ones in a font Word kerns only without ligatures, such as Trebuchet MS; Times New Roman's discretional ligatures, kerned, beside some characters; ligatures in a font whose ligatures aren't known, of a setting Word's Font dialog doesn't write, in regular Cambria, or beside a character outside Windows-1252; kerning and ligatures across a soft hyphen, and kerned text before one in its font, with which the hyphen Word draws at the end of a line may be kerned; a word longer than its line, kerned or with ligatures, as where Word breaks it hasn't been seen; text kerned or with ligatures on a document grid of characters; and in a font's file, substitutions other than ligatures in the setting's features, such as contextual ones. Text with OpenType number forms or spacing, stylistic sets or contextual alternates (`w14:numForm`, `w14:numSpacing`, `w14:stylisticSets`, `w14:cntxtAlts`) stops too, as their widths aren't known
|
||||
- a character whose width in its font isn't known, so its line may not be where Word puts it: a letter or symbol its font doesn't have, or its font's file has no glyph for, which Word draws in another font, such as most mathematical symbols in Calibri, Arial and Courier New, which Word draws in Cambria Math, and the Greek and Cyrillic letters Gill Sans MT doesn't have, which Word draws in Calibri; a few that Word drew in a way their widths can't be read from, such as Ž and Ё in Courier New; and a symbol font's own symbol, such as Wingdings' tick (`SymbolRun`), or a symbol whose character isn't four hexadecimal digits
|
||||
- in a document that hyphenates its words, a line Word may end with a part of the next word and a hyphen: one with room for the word's first two letters and a hyphen, or its first letter in a language other than English, when the word has five letters or more, or two in such a language. A word longer than its line, a word squeezed onto a distributed line, and a table sized to its text whose columns are narrowed past a word Word may hyphenate, or given less than one, stop it too, as Word sizes columns to the parts of the words it hyphenates
|
||||
- a document that compresses its punctuation, or uses Word's strict rules for the characters that can't start a line
|
||||
- a soft hyphen where Word hasn't been seen breaking at it: in a justified line the word doesn't fit squeezed onto, in a word whose part before it is longer than its line or that has a border, where its hyphen ends a few twips before the end of the line, and in a table whose columns Word sizes to their text or widens for long words
|
||||
@@ -293,7 +293,7 @@ const doc = new Document({
|
||||
|
||||
Its guesses, by what it would stop at:
|
||||
|
||||
- text in a font that isn't in the width tables, isn't given as a file and isn't embedded is measured as the most similar font that is: Calibri Light and Segoe UI as Calibri, a serif font such as Georgia or Garamond as Times New Roman, a monospaced one as Courier New, and the others, such as Aptos, as Arial. Word draws them with their own widths, when it has them: in Word's PDF, Aptos was 2% narrower than its guess, Georgia 9% wider and Verdana 13% wider (`word-watertight-text.docx` TX18). A character whose width in its font isn't known is measured as an average letter of the font
|
||||
- text in a font that isn't in the width tables, isn't given as a file and isn't embedded is measured as the most similar font that is: Segoe UI as Calibri, a serif font such as Garamond as Times New Roman, a monospaced one as Courier New, and the others, such as Roboto, as Arial. Word draws them with their own widths, when it has them: in Word's PDF, Segoe UI was 1% wider than its guess and Garamond 3% narrower (`word-watertight-text.docx` TX18). Bold that Word makes itself is measured as the face it makes it from. A character whose width in its font isn't known is measured as an average letter of the font
|
||||
- kerning and ligatures Word's PDFs haven't shown are measured as the layout measures the rest: a pair whose kerning isn't known, or a word longer than its line, as if not kerned, and text either side of a soft hyphen as one word
|
||||
- a date or time is measured as it is written, where Word writes the date and time it opens the document
|
||||
- a setting or formatting the layout doesn't follow, such as hyphenation, a compatibility setting or mode, a document grid, a text frame or an indent in characters it hasn't seen, is laid out as if it weren't there, a page number in a format it can't write is written in figures, and a table whose widths it can't work out as Word does is sized as it sizes others. A table that text wraps around where Word's way with it hasn't been seen is laid out in the text, as one it doesn't wrap around
|
||||
@@ -316,17 +316,18 @@ Guessing is off by default, so the page numbers written are Word's, as near as `
|
||||
|
||||
## Kerning and ligatures
|
||||
|
||||
Word kerns text that asks for it (`kern` on a run or a style, `w:kern`) from that size up, and joins letters into ligatures in text that asks for them (`w14:ligatures`, which `docx` doesn't write, but Word's own Normal template has, as documents and templates Word made do). Word's Normal template kerns from 1 point, which `kern: 2` asks for, and has standard and contextual ligatures. The layout does both as Word does, from Word's PDF of every pair of the characters of Windows-1252 kerned in Calibri, Cambria, Arial, Times New Roman and Courier New, plain, bold, italic and bold italic, and the letters Word joined in them with each setting of its Font dialog:
|
||||
Word kerns text that asks for it (`kern` on a run or a style, `w:kern`) from that size up, and joins letters into ligatures in text that asks for them (`w14:ligatures`, which `docx` doesn't write, but Word's own Normal template has, as documents and templates Word made do). Word's Normal template kerns from 1 point, which `kern: 2` asks for, and has standard and contextual ligatures. The layout does both as Word does, from Word's PDF of every pair of the characters of Windows-1252 kerned in Calibri, Cambria, Arial, Times New Roman and Courier New, plain, bold, italic and bold italic, and the letters Word joined in them with each setting of its Font dialog, and from Word's PDFs of the same in Office's other fonts of the tables, with Normal's ligatures and with all:
|
||||
|
||||
- **Kerning** brings pairs such as "To" and "AV" nearer, and, in Arial and Times New Roman, an A, L, P, T, V, W or Y nearer the space beside it. Courier New kerns nothing. Pairs across runs of the same font, formatting and language are kerned too, but not across runs of other languages, which Word kerns apart, though it does across runs of other colours. Text kerned from a size larger than it isn't kerned
|
||||
- **Ligatures**: Calibri joins ff, fi, fl, ffi, ffl, ft, tt, tti, ti and others, about 2% narrower than its letters, with standard ligatures and with all; and ch, ck, ct, st and ij with discretional ones. Times New Roman joins fi, fl, ff, ffi, ffl, fj, ffj and Th, much narrower, only with discretional ligatures, and Arial and Courier New join nothing. Cambria draws an f before some letters another way, as wide. Word joins no letters in text with space between its characters (`characterSpacing`), and joins them across runs as it kerns them. Text either side of hidden or deleted text, or of a paragraph mark that is hidden or deleted, which Word joins to the next, is kerned and joined as if the two were next to each other, which Word's PDFs haven't shown
|
||||
- The glyphs ligatures make are kerned with what is beside them as Word kerns them
|
||||
- **Office's other fonts** are kerned as their own files kern them, as Word kerns them, but for a no-break space, which Word kerns as the space in Trebuchet MS and Gill Sans MT, and not at all in Corbel and Constantia. Text with ligatures is kerned only where a font's kerning is in its `GPOS` table: Word leaves it without kerning in Trebuchet MS, Verdana, Tahoma, Impact, Gill Sans MT and Franklin Gothic Book, whose kerning is in their `kern` tables alone, and kerns the same text without ligatures. Calibri Light joins letters as Calibri does; Candara, Corbel and Constantia join ff, fi, fl, fb, fh, fj and fk, and ffi, ffl and the like, with Normal's ligatures and with all; Aptos and Aptos Narrow join ff, fi and fl, as wide as their letters, and fj too with all; Tahoma joins ff, fi, fl, ft and st and Consolas fi and fl only with all of them; and Georgia, Trebuchet MS, Verdana, Century Gothic, Book Antiqua, Gill Sans MT, Franklin Gothic Book and Impact join nothing. Word's PDFs showed their ligatures with Normal's setting and with all, so the layout stops at the others in a font that joins letters, and takes a font that joins none with all of them to join none with any. Italic text in a font without an italic face is kerned and joined as upright, and bold text in one without a bold face stops the layout
|
||||
|
||||
Where Word's PDFs don't show how it kerns or joins text, the layout stops, as [What it leaves blank](#what-it-leaves-blank) lists. Fonts given as files are kerned and joined from their own tables (see [Measuring fonts from their files](#measuring-fonts-from-their-files)).
|
||||
|
||||
## How close it is
|
||||
|
||||
Text in fonts made with the same widths as those five is measured exactly as them: Carlito as Calibri, Caladea as Cambria, Liberation Sans, Arimo and Helvetica as Arial, Liberation Serif and Tinos as Times New Roman, and Liberation Mono and Cousine as Courier New. Text in the fonts the document embeds (`fonts`) is measured from their files, as Word draws it in them. Text in other fonts, such as Aptos, Office's default font since 2023, stops the layout (see [What it leaves blank](#what-it-leaves-blank)), unless their files are given (see [Measuring fonts from their files](#measuring-fonts-from-their-files)). Characters the width tables don't have, such as Hebrew, Arabic and Thai letters, box drawing, shapes such as the bullets ● and ■, and emoji, are measured as an average letter of the font, or an em for emoji. The Latin letters of the East Asian fonts that aren't monospaced, such as Yu Gothic, and East Asian fonts Office doesn't have stop the layout too.
|
||||
Text in fonts made with the same widths as those five is measured exactly as them: Carlito as Calibri, Caladea as Cambria, Liberation Sans, Arimo and Helvetica as Arial, Liberation Serif and Tinos as Times New Roman, and Liberation Mono and Cousine as Courier New. Text in the fonts the document embeds (`fonts`) is measured from their files, as Word draws it in them. Text in Aptos, Office's default font since 2023, and Office's other fonts of the tables is measured with Word's own files of them: each word of a line of prose in each of them but Verdana, whose line Word's PDF broke in two, kerned and with ligatures as Word's Normal template has them, is within half a point of where Word puts it, across lines of 1,100 to 1,400 points. Text in other fonts, such as Garamond, stops the layout (see [What it leaves blank](#what-it-leaves-blank)), unless their files are given (see [Measuring fonts from their files](#measuring-fonts-from-their-files)). Characters the width tables don't have, such as Hebrew, Arabic and Thai letters, box drawing, shapes such as the bullets ● and ■, and emoji, are measured as an average letter of the font, or an em for emoji. The Latin letters of the East Asian fonts that aren't monospaced, such as Yu Gothic, and East Asian fonts Office doesn't have stop the layout too.
|
||||
|
||||
Each change to `docx/layout` is checked against LibreOffice's layout of a set of documents, and against the pages Word marked in documents it saved. Word lays out some things differently from LibreOffice, so turn `updateFields` on if the page numbers must be Word's own once the document is opened in Word: Word then asks to update the fields, and works them out again. LibreOffice rounds the height of each line to whole twips, 269 for Calibri 11, so where a line only just fits on a page, it can be on the next page in LibreOffice and on this one in Word, and in `docx/layout`, which follows Word.
|
||||
|
||||
@@ -369,7 +370,7 @@ const doc = new Document({
|
||||
});
|
||||
```
|
||||
|
||||
Pretext only measures how wide words and spaces are. The rest is laid out as Word lays it out: lines break where Word breaks them, rather than where a browser would, tabs move to the paragraph's tab stops, and lines are as tall as Word makes them. Their heights still come from the tables, so the layout stops at text in a font that isn't in them, such as Aptos, as how tall Word makes its lines isn't known, unless its file is given too (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) or the document embeds it.
|
||||
Pretext only measures how wide words and spaces are. The rest is laid out as Word lays it out: lines break where Word breaks them, rather than where a browser would, tabs move to the paragraph's tab stops, and lines are as tall as Word makes them. Their heights still come from the tables, so the layout stops at text in a font that isn't in them, such as Garamond, as how tall Word makes its lines isn't known, unless its file is given too (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) or the document embeds it.
|
||||
|
||||
- Pretext needs a canvas to measure with: an `OffscreenCanvas`, or a page's. Node has neither, so use `estimatePageNumbers` there.
|
||||
- Load the fonts before the document is written, such as with `document.fonts.load('11pt "Calibri"')`. A font that hasn't loaded is measured as the browser's default font, and Pretext keeps the widths it measured.
|
||||
|
||||
@@ -24,23 +24,37 @@
|
||||
* them, from LK, where it read them. A glyph Word put in place of letters that is as
|
||||
* wide as they are and kerned as they are, as Cambria's f before some letters is, changes nothing, and isn't a rule.
|
||||
*
|
||||
* Office's other fonts that Word for Mac installs (scripts/office-fonts.ts), from Word's PDFs of
|
||||
* scripts/layout-probes/stops2/word-stops-font-kerning.ts, which has the same pairs and words in each of their faces, are
|
||||
* kerned as Word's own files of them are, as the four above are kerned as the open fonts, which Word's PDF shows they are
|
||||
* for all but a few pairs. The glyphs their ligatures make are as wide as the files have them, and kerned as the files
|
||||
* kern them. A face a font has no file for, which Word makes itself, has none: an italic is kerned as the upright face,
|
||||
* as Word draws Trebuchet MS bold italic as its bold, slanted, and kerns it as the bold (K18).
|
||||
*
|
||||
* Usage, with Poppler, and the open fonts copied out of the image scripts/shape-demos/Dockerfile builds, as
|
||||
* scripts/generate-font-widths.ts says:
|
||||
* scripts/generate-font-widths.ts says, then the directories Word's own fonts are in, searched in order:
|
||||
* pdftocairo -svg scripts/layout-probes/word-kerning.pdf build/word-probes/word-kerning.svg
|
||||
* pdftotext -bbox-layout scripts/layout-probes/word-kerning.pdf build/word-probes/word-kerning.html
|
||||
* python3 scripts/layout-probes/word-kerning.py build/word-probes/word-kerning --json > build/word-probes/word-kerning.word.json
|
||||
* npm run run-ts -- scripts/generate-font-kerning.ts build/word-probes/word-kerning.word.json build/fonts
|
||||
* and the same for scripts/layout-probes/stops2/word-stops-font-kerning.pdf and word-stops-font-kerning2.pdf, then
|
||||
* npm run run-ts -- scripts/generate-font-kerning.ts build/word-probes/word-kerning.word.json build/fonts \
|
||||
* "/Applications/Microsoft Word.app/Contents/Resources/DFonts" /System/Library/Fonts/Supplemental \
|
||||
* build/word-probes/word-stops-font-kerning.word.json build/word-probes/word-stops-font-kerning2.word.json
|
||||
*
|
||||
* Each reading's probe's lines, which word-kerning.py wrote beside it, are read from the .json of the probe's name in
|
||||
* scripts/layout-probes, or in scripts/layout-probes/stops2.
|
||||
*/
|
||||
// cspell:ignore Caladea Carlito bbox pdftocairo Poppler
|
||||
// cspell:ignore Caladea Carlito bbox pdftocairo Poppler DFonts DFLT
|
||||
import { execSync } from "node:child_process";
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
||||
import { basename, join } from "node:path";
|
||||
|
||||
import { readFontFile } from "../src/text-layout/font-file";
|
||||
import { type Glyph, WINDOWS_1252, indexRules, joinLetters } from "../src/text-layout/kerning";
|
||||
|
||||
import { OFFICE_FONTS } from "./office-fonts";
|
||||
|
||||
const OUTPUT = "src/text-layout/font-kerning.ts";
|
||||
const SIDECAR = "scripts/layout-probes/word-kerning.json";
|
||||
|
||||
/** What word-kerning.py reads, with --json */
|
||||
type Reading = {
|
||||
@@ -58,34 +72,81 @@ type Reading = {
|
||||
type Line = readonly [probe: string, face: string, kerned: boolean, ligatures: string, text: string];
|
||||
type Rule = readonly [letters: string, units: readonly (number | string)[], next?: string];
|
||||
|
||||
const [readingPath, fontDirectory] = process.argv.slice(2);
|
||||
if (!readingPath || !fontDirectory) {
|
||||
// The readings of Word's PDFs, as JSON, and the directories of fonts: the open fonts', then Word's own
|
||||
const argumentsGiven = process.argv.slice(2);
|
||||
const readingPaths = argumentsGiven.filter((path) => path.endsWith(".json"));
|
||||
const [fontDirectory, ...officeDirectories] = argumentsGiven.filter(
|
||||
(path) => !path.endsWith(".json") && existsSync(path) && statSync(path).isDirectory(),
|
||||
);
|
||||
if (readingPaths.length === 0 || !fontDirectory || officeDirectories.length === 0) {
|
||||
console.error(
|
||||
"Usage: npm run run-ts -- scripts/generate-font-kerning.ts <word-kerning.py --json's output> <directory with the open fonts>",
|
||||
"Usage: npm run run-ts -- scripts/generate-font-kerning.ts <word-kerning.py --json's outputs>... <directory with the open fonts> <directories of Word's fonts>...",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
const reading = JSON.parse(readFileSync(readingPath, "utf8")) as Reading;
|
||||
const lines = (JSON.parse(readFileSync(SIDECAR, "utf8")) as { readonly lines: readonly Line[] }).lines;
|
||||
/** The probe's lines a reading is of, from the .json of its name, such as word-kerning.json for word-kerning.word.json */
|
||||
const linesOf = (path: string): readonly Line[] => {
|
||||
const name = `${basename(path).replace(/\.word\.json$/, "")}.json`;
|
||||
const sidecar = ["scripts/layout-probes", "scripts/layout-probes/stops2"].map((folder) => join(folder, name)).find(existsSync);
|
||||
if (sidecar === undefined) {
|
||||
throw new Error(`No probe's lines for ${path}: ${name} isn't in scripts/layout-probes or its stops2`);
|
||||
}
|
||||
return (JSON.parse(readFileSync(sidecar, "utf8")) as { readonly lines: readonly Line[] }).lines;
|
||||
};
|
||||
const READINGS = readingPaths.map((path) => ({ reading: JSON.parse(readFileSync(path, "utf8")) as Reading, lines: linesOf(path) }));
|
||||
/** The reading of a face, and its probe's lines */
|
||||
const readingOf = (face: string): (typeof READINGS)[number] => {
|
||||
const found = READINGS.find(({ reading }) => reading.kerning[face] !== undefined);
|
||||
if (found === undefined) {
|
||||
throw new Error(`None of Word's PDFs read have ${face}`);
|
||||
}
|
||||
return found;
|
||||
};
|
||||
/** The path of one of Word's own font files, from the first of the directories it is in */
|
||||
const officeFileOf = (file: string): string => {
|
||||
const found = officeDirectories.map((folder) => join(folder, file)).find(existsSync);
|
||||
if (found === undefined) {
|
||||
throw new Error(`${file} isn't in ${officeDirectories.join(", ")}`);
|
||||
}
|
||||
return found;
|
||||
};
|
||||
|
||||
// Each font, and the open font as wide as it, whose kerning Word's is but for a few pairs, or none for Cambria
|
||||
const FONTS = [
|
||||
{ name: "Calibri", open: "Carlito" },
|
||||
{ name: "Cambria" },
|
||||
{ name: "Arial", open: "LiberationSans" },
|
||||
{ name: "Times New Roman", open: "LiberationSerif" },
|
||||
{ name: "Courier New", open: "LiberationMono" },
|
||||
] as const;
|
||||
const FACES = [
|
||||
["regular", "", "Regular"],
|
||||
["bold", " bold", "Bold"],
|
||||
["italic", " italic", "Italic"],
|
||||
["boldItalic", " bold italic", "BoldItalic"],
|
||||
] as const;
|
||||
type FaceKey = (typeof FACES)[number][0];
|
||||
// Each font, and the file of each face whose kerning Word's is but for a few pairs: the open font as wide as it, or
|
||||
// Word's own file, or none for Cambria, whose open font kerns too few. A face of one of Office's fonts with no file is one
|
||||
// Word makes itself, which has no kerning of its own
|
||||
const FONTS: readonly { readonly name: string; readonly files?: Readonly<Partial<Record<FaceKey, string>>>; readonly own?: boolean }[] = [
|
||||
...[
|
||||
{ name: "Calibri", open: "Carlito" },
|
||||
{ name: "Cambria" },
|
||||
{ name: "Arial", open: "LiberationSans" },
|
||||
{ name: "Times New Roman", open: "LiberationSerif" },
|
||||
{ name: "Courier New", open: "LiberationMono" },
|
||||
].map(({ name, open }) => ({
|
||||
name,
|
||||
...(open === undefined
|
||||
? {}
|
||||
: { files: Object.fromEntries(FACES.map(([key, , suffix]) => [key, join(fontDirectory, `${open}-${suffix}.ttf`)])) }),
|
||||
})),
|
||||
...OFFICE_FONTS.map(({ name, files }) => ({
|
||||
name,
|
||||
files: Object.fromEntries(Object.entries(files).map(([key, file]) => [key, officeFileOf(file)])),
|
||||
own: true,
|
||||
})),
|
||||
];
|
||||
const ASCII = Array.from({ length: 0x7f - 0x20 }, (_, index) => String.fromCodePoint(0x20 + index)).join("");
|
||||
const NO_BREAK_SPACE = " ";
|
||||
// The characters Word moves a little of its own accord, so the pairs before them aren't read
|
||||
const MOVED = new Set(["-", "–", NO_BREAK_SPACE, "™", "\\", "à"]);
|
||||
// In Office's other fonts, Word moves ý too: the pairs before it are as scattered as those before à, by up to 16
|
||||
// thousandths of an em either way, in faces whose files kern nothing with it, such as Impact's and Georgia's
|
||||
const MOVED_IN_OFFICE_FONTS = new Set([...MOVED, "ý"]);
|
||||
|
||||
const DIGITS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/";
|
||||
const twoDigits = (value: number): string => {
|
||||
@@ -103,8 +164,8 @@ const lettersOf = (name: string): string => (isGlyph(name) ? name.slice(1, name.
|
||||
/** The words of L of a face and setting, each after a space */
|
||||
const wordsOf = (face: string, setting: string): readonly string[] => [
|
||||
...new Set(
|
||||
lines
|
||||
.filter(([probe, other, , ligatures]) => /^L\d/.test(probe) && other === face && ligatures === setting)
|
||||
readingOf(face)
|
||||
.lines.filter(([probe, other, , ligatures]) => /^L\d/.test(probe) && other === face && ligatures === setting)
|
||||
.flatMap(([, , , , text]) => text.split(" ").filter((word) => word.length > 0)),
|
||||
),
|
||||
];
|
||||
@@ -112,8 +173,13 @@ const wordsOf = (face: string, setting: string): readonly string[] => [
|
||||
/**
|
||||
* The kerning of each pair of characters, in thousandths of an em, or NaN where it isn't known, by "first|second".
|
||||
*/
|
||||
const kerningOfCharacters = (face: string, characters: readonly string[], open?: string): Map<string, number> => {
|
||||
const measured = reading.kerning[face];
|
||||
const kerningOfCharacters = (
|
||||
face: string,
|
||||
characters: readonly string[],
|
||||
open?: string,
|
||||
moved: ReadonlySet<string> = MOVED,
|
||||
): Map<string, number> => {
|
||||
const measured = readingOf(face).reading.kerning[face];
|
||||
const read = (left: string, right: string): number => measured[left + right] ?? Number.NaN;
|
||||
const kerning = new Map<string, number>();
|
||||
if (open === undefined) {
|
||||
@@ -160,13 +226,13 @@ const kerningOfCharacters = (face: string, characters: readonly string[], open?:
|
||||
);
|
||||
return kerning;
|
||||
}
|
||||
const [font] = readFontFile(readFileSync(join(fontDirectory, open)));
|
||||
const [font] = readFontFile(readFileSync(open));
|
||||
const prior = (left: string, right: string): number => {
|
||||
const [first, second] = [left, right].map((character) => character.codePointAt(0)!);
|
||||
return font.advanceOf(first) === undefined || font.advanceOf(second) === undefined ? 0 : font.kerningOf(first, second) * 1000;
|
||||
};
|
||||
// A no-break space is kerned as the space where Word kerns it with what is after it as it does the space
|
||||
const steadyColumns = characters.filter((right) => !MOVED.has(right));
|
||||
const steadyColumns = characters.filter((right) => !moved.has(right));
|
||||
const spaceLike =
|
||||
characters.includes(NO_BREAK_SPACE) &&
|
||||
steadyColumns.filter((right) => Math.abs(read(NO_BREAK_SPACE, right) - read(" ", right)) <= 2.5).length >=
|
||||
@@ -174,7 +240,7 @@ const kerningOfCharacters = (face: string, characters: readonly string[], open?:
|
||||
const asSpace = (character: string): string => (spaceLike && character === NO_BREAK_SPACE ? " " : character);
|
||||
const openOf = (left: string, right: string): number => prior(asSpace(left), asSpace(right));
|
||||
const offBy = (left: string, right: string): number => read(left, right) - openOf(left, right);
|
||||
const off = (left: string, right: string): boolean => !MOVED.has(right) && Math.abs(offBy(left, right)) > 5.5;
|
||||
const off = (left: string, right: string): boolean => !moved.has(right) && Math.abs(offBy(left, right)) > 5.5;
|
||||
const rowKey = new Map(characters.map((left) => [left, characters.map((right) => Math.round(openOf(left, right))).join(",")]));
|
||||
// A row Word kerns otherwise has at least 5 pairs off, as Word's font kerns classes of characters, where Word's
|
||||
// drawing is off here and there
|
||||
@@ -185,7 +251,7 @@ const kerningOfCharacters = (face: string, characters: readonly string[], open?:
|
||||
const value = read(left, right);
|
||||
const own =
|
||||
!Number.isNaN(value) &&
|
||||
!MOVED.has(right) &&
|
||||
!moved.has(right) &&
|
||||
(((ownRows.has(left) || ownColumns.has(right)) && Math.abs(offBy(left, right)) > 1.5) ||
|
||||
(off(left, right) &&
|
||||
characters.filter(
|
||||
@@ -263,15 +329,58 @@ const classesBy = <T>(items: readonly T[], keyOf: (item: T) => string, zero: str
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether a font file's GPOS table kerns Latin text: whether the features of its Latin script, or its default one when it
|
||||
* has none, have kerning. Word kerns text with ligatures with those alone, and leaves text in a font whose kerning is
|
||||
* only in its kern table, such as Trebuchet MS, Tahoma, Impact, Gill Sans MT and Franklin Gothic Book, not kerned, where
|
||||
* it kerns the same text without ligatures (word-stops-font-kerning P, against K)
|
||||
*/
|
||||
const kernsLatinInGlyphPositioning = (path: string): boolean => {
|
||||
const data = readFileSync(path);
|
||||
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
||||
const tables = new Map(
|
||||
Array.from({ length: view.getUint16(4) }, (_, index) => {
|
||||
const at = 12 + index * 16;
|
||||
return [String.fromCharCode(...data.subarray(at, at + 4)), view.getUint32(at + 8)] as const;
|
||||
}),
|
||||
);
|
||||
const gpos = tables.get("GPOS");
|
||||
if (gpos === undefined) {
|
||||
return false;
|
||||
}
|
||||
const tagAt = (offset: number): string => String.fromCharCode(...data.subarray(offset, offset + 4));
|
||||
const scripts = gpos + view.getUint16(gpos + 4);
|
||||
const features = gpos + view.getUint16(gpos + 6);
|
||||
const scriptTags = Array.from({ length: view.getUint16(scripts) }, (_, index) => scripts + 2 + index * 6);
|
||||
const script = scriptTags.find((at) => tagAt(at) === "latn") ?? scriptTags.find((at) => tagAt(at) === "DFLT");
|
||||
if (script === undefined) {
|
||||
return false;
|
||||
}
|
||||
const table = scripts + view.getUint16(script + 4);
|
||||
const languageSystem = view.getUint16(table);
|
||||
if (languageSystem === 0) {
|
||||
return false;
|
||||
}
|
||||
const system = table + languageSystem;
|
||||
return Array.from({ length: view.getUint16(system + 4) }, (_, index) => view.getUint16(system + 6 + index * 2)).some(
|
||||
(feature) => tagAt(features + 2 + feature * 6) === "kern",
|
||||
);
|
||||
};
|
||||
|
||||
const generated: string[] = [];
|
||||
const report: string[] = [];
|
||||
for (const { name: font, ...rest } of FONTS) {
|
||||
const open = "open" in rest ? rest.open : undefined;
|
||||
for (const { name: font, files, own = false } of FONTS) {
|
||||
const faces: string[] = [];
|
||||
for (const [key, suffix, file] of FACES) {
|
||||
for (const [key, suffix] of FACES) {
|
||||
const face = `${font}${suffix}`;
|
||||
const path = files?.[key];
|
||||
// A face of one of Office's fonts that Word makes itself has no kerning of its own
|
||||
if (own && path === undefined) {
|
||||
continue;
|
||||
}
|
||||
const { reading } = readingOf(face);
|
||||
const characters = [...(font === "Courier New" ? ASCII : WINDOWS_1252)];
|
||||
const kerning = kerningOfCharacters(face, characters, open === undefined ? undefined : `${open}-${file}.ttf`);
|
||||
const kerning = kerningOfCharacters(face, characters, path, own ? MOVED_IN_OFFICE_FONTS : MOVED);
|
||||
|
||||
// The settings whose words were all read, but those ending in a no-break space, which no font joins
|
||||
const settings = Object.keys(reading.joined)
|
||||
@@ -286,14 +395,50 @@ for (const { name: font, ...rest } of FONTS) {
|
||||
const allNames = [...new Set(settings.flatMap((setting) => Object.values(reading.joined[`${face}|${setting}`]).flat()))].filter(
|
||||
isGlyph,
|
||||
);
|
||||
// A glyph as wide as its letters and kerned as they are changes nothing
|
||||
const openFace = path === undefined ? undefined : readFontFile(readFileSync(path))[0];
|
||||
/** The glyph the open font, or Word's own file, joins a ligature's letters into, or a character's glyph */
|
||||
const openGlyphOf = (name: string): number | undefined => {
|
||||
if (openFace === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
const glyphs = [...lettersOf(name)].map((letter) => openFace.glyphOf(letter.codePointAt(0)!));
|
||||
const joinedGlyphs = isGlyph(name) ? openFace.join(glyphs, "all").glyphs : glyphs;
|
||||
return joinedGlyphs.length === 1 && joinedGlyphs[0] !== 0 ? joinedGlyphs[0] : undefined;
|
||||
};
|
||||
// A glyph as wide as its letters and kerned as they are changes nothing, but where its letters are kerned with each
|
||||
// other, which Word doesn't kern in the glyph, or, in Word's own file of one of Office's fonts, the glyph is kerned
|
||||
// otherwise than its letters are with a character beside it, as Aptos's ff is with an e, which its f is and its ff
|
||||
// isn't (word-stops-font-kerning P: "offered" 0.13 points wider in Word than its letters kerned)
|
||||
const widthOfLetters = (name: string): number =>
|
||||
[...lettersOf(name)].reduce((total, letter) => total + (advances[letter] ?? Number.NaN), 0);
|
||||
const kernedOtherwiseInFile = (name: string): boolean => {
|
||||
const glyph = own ? openGlyphOf(name) : undefined;
|
||||
if (glyph === undefined) {
|
||||
return false;
|
||||
}
|
||||
const letters = [...lettersOf(name)];
|
||||
return characters.some((character) => {
|
||||
const other = openGlyphOf(character);
|
||||
return (
|
||||
other !== undefined &&
|
||||
(Math.abs(
|
||||
openFace!.kerningOfGlyphs(glyph, other) * 1000 - (kerning.get(`${letters[letters.length - 1]}|${character}`) ?? 0),
|
||||
) > 0.5 ||
|
||||
Math.abs(openFace!.kerningOfGlyphs(other, glyph) * 1000 - (kerning.get(`${character}|${letters[0]}`) ?? 0)) > 0.5)
|
||||
);
|
||||
});
|
||||
};
|
||||
const changes = (name: string): boolean => {
|
||||
if (advances[name] === undefined || !(Math.abs(advances[name] - widthOfLetters(name)) <= 1)) {
|
||||
return true;
|
||||
}
|
||||
const letters = [...lettersOf(name)];
|
||||
if (
|
||||
letters.slice(1).some((letter, index) => (kerning.get(`${letters[index]}|${letter}`) ?? 0) !== 0) ||
|
||||
kernedOtherwiseInFile(name)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return settings.some((setting) =>
|
||||
Object.entries(besideOf(setting)).some(([pair, value]) => {
|
||||
const [left, right] = pair.split("|");
|
||||
@@ -309,7 +454,19 @@ for (const { name: font, ...rest } of FONTS) {
|
||||
};
|
||||
const names = allNames.filter(changes);
|
||||
const glyphIndex = (name: string): number => names.indexOf(name);
|
||||
const widths = names.map((name) => Math.round(advances[name]));
|
||||
// The glyphs' widths: Word's, or those of Word's own file, where it joins the same letters, which Word's PDF shows
|
||||
// to within its reading, and has where it reads none, as at the end of a line
|
||||
const widths = names.map((name) => {
|
||||
const glyph = own ? openGlyphOf(name) : undefined;
|
||||
if (glyph === undefined) {
|
||||
return Math.round(advances[name]);
|
||||
}
|
||||
const width = openFace!.advanceOfGlyph(glyph) * 1000;
|
||||
if (advances[name] !== undefined && Math.abs(advances[name] - width) > 1.5) {
|
||||
report.push(`${face}: Word's PDF reads ${name} ${advances[name]} wide, where the file has ${width.toFixed(1)}`);
|
||||
}
|
||||
return Math.round(width);
|
||||
});
|
||||
const plainGlyphs = names.map((name, index) => [lettersOf(name), widths[index], -1, -1] as const);
|
||||
const rules = Object.fromEntries(
|
||||
settings.map((setting) => {
|
||||
@@ -326,17 +483,9 @@ for (const { name: font, ...rest } of FONTS) {
|
||||
|
||||
// The kerning of the ligatures' glyphs with the glyphs beside them: the open font's, where it joins the same
|
||||
// letters, as Carlito does Calibri's, whose kerning of them Word's PDF shows is Word's for 98.8% of the pairs it
|
||||
// read, and those off are as off as the pairs before the characters Word moves; or from LK
|
||||
const openFace = open === undefined ? undefined : readFontFile(readFileSync(join(fontDirectory, `${open}-${file}.ttf`)))[0];
|
||||
// read, and those off are as off as the pairs before the characters Word moves; or from LK. Office's fonts' are
|
||||
// their own files', as their pairs of characters are
|
||||
const units = [...characters, ...names];
|
||||
const openGlyphOf = (name: string): number | undefined => {
|
||||
if (openFace === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
const glyphs = [...lettersOf(name)].map((letter) => openFace.glyphOf(letter.codePointAt(0)!));
|
||||
const joinedGlyphs = isGlyph(name) ? openFace.join(glyphs, "all").glyphs : glyphs;
|
||||
return joinedGlyphs.length === 1 && joinedGlyphs[0] !== 0 ? joinedGlyphs[0] : undefined;
|
||||
};
|
||||
for (const name of names) {
|
||||
for (const other of units) {
|
||||
for (const [left, right] of [
|
||||
@@ -417,6 +566,7 @@ for (const { name: font, ...rest } of FONTS) {
|
||||
` pairs: "${[...pairs].map(([classes, value]) => classes + twoDigits(value)).join("")}",`,
|
||||
` glyphs: ${JSON.stringify(glyphs)},`,
|
||||
` ligatures: ${JSON.stringify(rules)},`,
|
||||
...(own && pairs.size > 0 && !kernsLatinInGlyphPositioning(path!) ? [" notKernedWithLigatures: true,"] : []),
|
||||
" },",
|
||||
].join("\n"),
|
||||
);
|
||||
@@ -430,10 +580,13 @@ const source = `/**
|
||||
* Generated by scripts/generate-font-kerning.ts from Word's PDF of scripts/layout-probes/word-kerning.ts, saved from Word
|
||||
* 16 for Mac: every pair of the characters of Windows-1252, and of printable ASCII in Courier New, kerned from 1 point;
|
||||
* words of the letters fonts join, with each ligature setting of Word's Font dialog; and the kerning beside the glyphs
|
||||
* they join. Do not edit by hand.
|
||||
* they join. And for Office's other fonts in the width tables, from Word's PDFs of
|
||||
* scripts/layout-probes/stops2/word-stops-font-kerning.ts, of the same pairs and words, and Word's own files of them. Do
|
||||
* not edit by hand.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
// cspell:ignore GPOS
|
||||
import type { Ligatures } from "./text-width";
|
||||
|
||||
/**
|
||||
@@ -467,6 +620,11 @@ export type FaceKerning = {
|
||||
readonly glyphs: readonly (readonly [letters: string, width: number, first: number, second: number])[];
|
||||
/** The rules of each ligature setting Word's PDF showed */
|
||||
readonly ligatures: Readonly<Partial<Record<Ligatures, readonly LigatureRule[]>>>;
|
||||
/**
|
||||
* Whether Word leaves the face's text not kerned when it has ligatures: it kerns text with ligatures as the font's GPOS
|
||||
* table kerns Latin text, which this face's file doesn't, and other text with its kern table
|
||||
*/
|
||||
readonly notKernedWithLigatures?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -476,9 +634,17 @@ export type FontKerning = {
|
||||
/** The font's name, as the width tables name it */
|
||||
readonly name: string;
|
||||
readonly regular: FaceKerning;
|
||||
readonly bold: FaceKerning;
|
||||
readonly italic: FaceKerning;
|
||||
readonly boldItalic: FaceKerning;
|
||||
/**
|
||||
* None for a font without a bold face, such as Calibri Light, whose bold Word makes itself, and whose kerning hasn't
|
||||
* been seen
|
||||
*/
|
||||
readonly bold?: FaceKerning;
|
||||
/**
|
||||
* None for a font without an italic face, such as Tahoma, whose italic Word slants from the upright face, and kerns
|
||||
* as it, as it does Trebuchet MS's bold italic, which it draws as its bold
|
||||
*/
|
||||
readonly italic?: FaceKerning;
|
||||
readonly boldItalic?: FaceKerning;
|
||||
};
|
||||
|
||||
/* cspell:disable */
|
||||
|
||||
+272
-52
@@ -1,8 +1,10 @@
|
||||
/**
|
||||
* Generates src/text-layout/font-widths.ts: how wide each character is
|
||||
* in the fonts Word documents use most, so shapes can be sized to fit their text and pages laid out.
|
||||
* in the fonts Word documents use most, and in Office's other fonts that Word installs, so shapes can be sized to fit
|
||||
* their text and pages laid out.
|
||||
*
|
||||
* The widths come from fonts with an open license that are made to have the same widths as Word's fonts:
|
||||
* Calibri, Cambria, Arial, Times New Roman and Courier New: the widths come from fonts with an open license that are made
|
||||
* to have the same widths as Word's fonts:
|
||||
* Carlito (Calibri), Caladea (Cambria), and Liberation Sans, Serif and Mono (Arial, Times New Roman and Courier New).
|
||||
* Carlito and Liberation are in the Debian packages fonts-crosextra-carlito and fonts-liberation2. Caladea is the one
|
||||
* LibreOffice installs with itself: the one in Debian's fonts-crosextra-caladea (20200211) has narrower letters and
|
||||
@@ -13,27 +15,52 @@
|
||||
* in italic and bold italic. Where Word's width isn't the open font's, it is Word's, and where Word draws the character in
|
||||
* another font, it isn't known, so the layout stops at it.
|
||||
*
|
||||
* Usage:
|
||||
* npm run run-ts -- scripts/generate-font-widths.ts <directory with the .ttf files> <Word's widths, as JSON> <Word's italic widths, as JSON>
|
||||
* Office's other fonts that Word for Mac installs, such as Calibri Light, Aptos, Georgia and Trebuchet MS ({@link
|
||||
* OFFICE_FONTS}): the widths and heights come from Word's own font files, which aren't open, so aren't in the image: those
|
||||
* in Word's folder of fonts, and Georgia, Impact and Trebuchet MS, which Word takes from the Mac's. Word's PDFs of
|
||||
* scripts/layout-probes/stops2/word-stops-font-widths.ts, which has every character of the tables in each of them, plain
|
||||
* and bold, and of word-stops-font-italic-widths, in italic and bold italic, show that Word draws each character the font
|
||||
* has as wide as its file has it, but for the spaces Word works out itself, which are Word's, as for the five above. A
|
||||
* character the font doesn't have, Word draws in another font, so it isn't known. A face the font has no file for, Word
|
||||
* makes itself: an italic slanted from the upright face, as wide as it, which the tables write as none, so the upright
|
||||
* face is measured; and a bold, each character 18 thousandths of an em wider than the face it is made from at 10 points,
|
||||
* which the tables leave out, so the layout stops at it. Each font's line is as tall as its file's hhea table makes it,
|
||||
* which Word's PDF of word-stops-font-heights shows (FH1 to FH16), with Corbel's and Book Antiqua's, whose ascent and
|
||||
* descent for Windows make their lines taller.
|
||||
*
|
||||
* To copy the fonts out of the image:
|
||||
* Usage, with the open fonts' directory first, then Word's widths, as JSON, of the five, and for Office's fonts the
|
||||
* directories Word's fonts are in, searched in order, Word's widths of them, and its heights of their lines:
|
||||
* npm run run-ts -- scripts/generate-font-widths.ts build/fonts build/word-probes/word-character-widths.word.json \
|
||||
* build/word-probes/word-italic-widths.word.json "/Applications/Microsoft Word.app/Contents/Resources/DFonts" \
|
||||
* /System/Library/Fonts/Supplemental build/word-probes/word-stops-font-widths.word.json \
|
||||
* build/word-probes/word-stops-font-italic-widths.word.json build/word-probes/word-stops-font-heights.word.json
|
||||
*
|
||||
* To copy the open fonts out of the image:
|
||||
* docker run --rm --platform linux/amd64 -v "$PWD/build/fonts:/out" docx-shape-renderer \
|
||||
* sh -c 'cp /usr/share/fonts/truetype/crosextra/Carlito-*.ttf /usr/share/fonts/truetype/liberation/*.ttf /out/ &&
|
||||
* cp "$(ls -d /opt/libreoffice*)"/share/fonts/truetype/Caladea-*.ttf /out/'
|
||||
*
|
||||
* To read Word's widths from its PDF, with Poppler (in the same image), and the same for word-italic-widths:
|
||||
* To read Word's widths from its PDF, with Poppler (in the same image), and the same for word-italic-widths and the
|
||||
* PDFs of scripts/layout-probes/stops2:
|
||||
* pdftotext -bbox-layout scripts/layout-probes/word-character-widths.pdf build/word-probes/word-character-widths.html
|
||||
* pdftohtml -xml -i -q -zoom 1 scripts/layout-probes/word-character-widths.pdf build/word-probes/word-character-widths
|
||||
* python3 scripts/layout-probes/word-character-widths.py build/word-probes/word-character-widths --json \
|
||||
* > build/word-probes/word-character-widths.word.json
|
||||
*
|
||||
* And Word's heights of the lines:
|
||||
* pdftotext -bbox-layout scripts/layout-probes/stops2/word-stops-font-heights.pdf build/word-probes/word-stops-font-heights.html
|
||||
* python3 scripts/layout-probes/stops2/word-font-heights.py build/word-probes/word-stops-font-heights --json \
|
||||
* > build/word-probes/word-stops-font-heights.word.json
|
||||
*/
|
||||
// cspell:ignore Caladea crosextra Poppler bbox pdftohtml
|
||||
// cspell:ignore Caladea crosextra Poppler bbox pdftohtml DFonts hhea Aptos
|
||||
import { execSync } from "node:child_process";
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { readFontFile } from "../src/text-layout/font-file";
|
||||
|
||||
import { OFFICE_FONTS, type OfficeFont } from "./office-fonts";
|
||||
|
||||
const OUTPUT = "src/text-layout/font-widths.ts";
|
||||
|
||||
// The faces of a font, each in a file of its own
|
||||
@@ -78,10 +105,13 @@ const HYPHEN = 0x2d;
|
||||
const SOFT_HYPHEN = 0xad;
|
||||
const NO_BREAK_HYPHEN = 0x2011;
|
||||
|
||||
const [directory, ...wordPaths] = process.argv.slice(2);
|
||||
if (!directory || wordPaths.length === 0) {
|
||||
// The open fonts' directory first, then the readings of Word's PDFs, as JSON, and the directories of Word's own fonts
|
||||
const [directory, ...rest] = process.argv.slice(2);
|
||||
const wordPaths = rest.filter((path) => path.endsWith(".json"));
|
||||
const fontDirectories = rest.filter((path) => !path.endsWith(".json") && existsSync(path) && statSync(path).isDirectory());
|
||||
if (!directory || wordPaths.length === 0 || fontDirectories.length === 0) {
|
||||
console.error(
|
||||
"Usage: npm run run-ts -- scripts/generate-font-widths.ts <directory with the .ttf files> <Word's widths, as JSON> <Word's italic widths, as JSON>",
|
||||
"Usage: npm run run-ts -- scripts/generate-font-widths.ts <directory with the open .ttf files> <directories of Word's fonts>... <Word's widths, as JSON>... <Word's heights, as JSON>",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -124,61 +154,125 @@ const readFont = (
|
||||
};
|
||||
};
|
||||
|
||||
/** The path of one of Word's own font files, from the first of the directories it is in */
|
||||
const officeFileOf = (file: string): string => {
|
||||
const found = fontDirectories.map((folder) => join(folder, file)).find(existsSync);
|
||||
if (found === undefined) {
|
||||
throw new Error(`${file} isn't in ${fontDirectories.join(", ") || "any directory of Word's fonts"}`);
|
||||
}
|
||||
return found;
|
||||
};
|
||||
|
||||
/**
|
||||
* How much wider one of Word's PDFs reads characters than they are: the middle of how much wider than the open fonts' Word's
|
||||
* How tall a line of one of Word's own fonts is, and how far it goes below its baseline, in thousandths of an em: as its
|
||||
* hhea table makes them, its ascender and descender and the line gap above them, as Word's lines are on the Mac
|
||||
* (word-stops-font-heights FH1 to FH16): Corbel's 1207.5 and Book Antiqua's 1205.6, where their ascent and descent for
|
||||
* Windows would make them 1220.7 and 1242.7
|
||||
*/
|
||||
const hheaOf = (path: string): { readonly lineHeight: number; readonly descent: number } => {
|
||||
const data = readFileSync(path);
|
||||
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
||||
const tables = new Map(
|
||||
Array.from({ length: view.getUint16(4) }, (_, index) => {
|
||||
const at = 12 + index * 16;
|
||||
return [String.fromCharCode(...data.subarray(at, at + 4)), view.getUint32(at + 8)] as const;
|
||||
}),
|
||||
);
|
||||
const unitsPerEm = view.getUint16(tables.get("head")! + 18);
|
||||
const hhea = tables.get("hhea")!;
|
||||
const [ascender, descender, lineGap] = [4, 6, 8].map((offset) => view.getInt16(hhea + offset));
|
||||
return { lineHeight: ((ascender - descender + lineGap) * 1000) / unitsPerEm, descent: (-descender * 1000) / unitsPerEm };
|
||||
};
|
||||
|
||||
/**
|
||||
* How much wider one of Word's PDFs reads characters than they are: the middle of how much wider than the fonts' Word's
|
||||
* widths of the characters in the faces' own fonts are, about 0.4 thousandths of an em, as Word's PDF puts each character
|
||||
* a little further on than its width
|
||||
*/
|
||||
const offsetOf = (word: WordWidths): number => {
|
||||
const differences = FONTS.flatMap((font) =>
|
||||
FACES.flatMap((face) => {
|
||||
const drawn = word.widths[keyOf(font.name, face)];
|
||||
if (drawn === undefined) {
|
||||
return [];
|
||||
}
|
||||
const { widthOf } = readFont(fileOf(font, face));
|
||||
return Object.entries(drawn).flatMap(([hex, { width, font: drawnIn }]) => {
|
||||
const open = widthOf(parseInt(hex, 16));
|
||||
return open !== undefined && isOwnFont(drawnIn, font.name) ? [width - open] : [];
|
||||
});
|
||||
const offsetOf = (
|
||||
word: WordWidths,
|
||||
faces: readonly { readonly key: string; readonly font: string; readonly widthOf: (code: number) => number | undefined }[],
|
||||
): number => {
|
||||
const differences = faces.flatMap(({ key, font, widthOf }) =>
|
||||
Object.entries(word.widths[key] ?? {}).flatMap(([hex, { width, font: drawnIn }]) => {
|
||||
const open = widthOf(parseInt(hex, 16));
|
||||
return open !== undefined && isOwnFont(drawnIn, font) ? [width - open] : [];
|
||||
}),
|
||||
);
|
||||
return [...differences].sort((one, other) => one - other)[Math.floor(differences.length / 2)];
|
||||
};
|
||||
|
||||
// Each of Word's PDFs, read, with how much wider it reads characters than they are
|
||||
const WORD = wordPaths.map((path) => {
|
||||
const word: WordWidths = JSON.parse(readFileSync(path, "utf8"));
|
||||
return { ...word, offset: offsetOf(word) };
|
||||
});
|
||||
// Each of Word's PDFs, read, with how much wider it reads characters than they are, from the faces of the fonts it has
|
||||
const READINGS = wordPaths.map((path) => JSON.parse(readFileSync(path, "utf8")));
|
||||
const WORD = READINGS.filter((reading): reading is WordWidths => reading.widths !== undefined).map((word) => ({
|
||||
...word,
|
||||
offset: offsetOf(
|
||||
word,
|
||||
[
|
||||
...FONTS.flatMap((font) =>
|
||||
FACES.map((face) => ({ key: keyOf(font.name, face), font: font.name, face, file: fileOf(font, face) })),
|
||||
),
|
||||
...OFFICE_FONTS.flatMap((font) =>
|
||||
FACES.flatMap((face) =>
|
||||
font.files[face] === undefined
|
||||
? []
|
||||
: [{ key: keyOf(font.name, face), font: font.name, face, file: officeFileOf(font.files[face]) }],
|
||||
),
|
||||
),
|
||||
]
|
||||
.filter(({ key }) => word.widths[key] !== undefined)
|
||||
.map(({ key, font, file }) => ({ key, font, widthOf: readFont(file).widthOf })),
|
||||
),
|
||||
}));
|
||||
// Word's heights of the lines of Office's fonts, in thousandths of an em, by font and size
|
||||
const HEIGHTS: Readonly<Record<string, Readonly<Record<string, number>>>> =
|
||||
READINGS.find((reading) => reading.heights !== undefined)?.heights ?? {};
|
||||
|
||||
/** The reading of Word's PDF that has a face */
|
||||
const wordOf = (key: string): (typeof WORD)[number] => {
|
||||
const word = WORD.find((reading) => reading.widths[key] !== undefined);
|
||||
if (word === undefined) {
|
||||
throw new Error(`None of Word's widths are of ${key}`);
|
||||
}
|
||||
return word;
|
||||
};
|
||||
|
||||
/**
|
||||
* The width of a character that takes no room, or that the layout measures as another: marks, which go on the character
|
||||
* before them, and formatting characters, such as the zero-width space, take no room, but for the soft hyphen, which Word
|
||||
* draws as a hyphen. A font without a soft hyphen, as Carlito has none, has it as wide as a hyphen, as Word draws it
|
||||
* (word-watertight-text TX10b: 67.4 twips for each U+00AD in Calibri 11), and the no-break hyphen is as wide as a hyphen,
|
||||
* as the layout reads `w:noBreakHyphen` as one, which Word draws as a hyphen whether the font has a no-break hyphen or not
|
||||
* (TX17: "state-of-the-art" 1388.3 twips with them and 1388.5 with hyphens). Undefined for the other characters.
|
||||
*/
|
||||
const specialWidthOf = (code: number, widthOf: (code: number) => number | undefined): number | undefined => {
|
||||
if (/[\p{Mn}\p{Me}\p{Cf}]/u.test(String.fromCodePoint(code)) && code !== SOFT_HYPHEN) {
|
||||
return 0;
|
||||
}
|
||||
if (code === SOFT_HYPHEN || code === NO_BREAK_HYPHEN) {
|
||||
return (code === SOFT_HYPHEN ? widthOf(code) : undefined) ?? widthOf(HYPHEN);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* The width of each character of a font's face, in thousandths of an em, or undefined where Word's width isn't known.
|
||||
* Each is the open font's, where Word's PDF shows it is Word's too, or else Word's own, and undefined where Word drew the
|
||||
* character in another font, which depends on the fonts where the document is opened, or where Word's PDF doesn't show
|
||||
* it. Marks, which go on the character before them, and formatting characters, such as the zero-width space, take no
|
||||
* room, but for the soft hyphen, which Word draws as a hyphen. A font without a soft hyphen, as Carlito has none, has it
|
||||
* as wide as a hyphen, as Word draws it (word-watertight-text TX10b: 67.4 twips for each U+00AD in Calibri 11), and the
|
||||
* no-break hyphen is as wide as a hyphen, as the layout reads `w:noBreakHyphen` as one, which Word draws as a hyphen
|
||||
* whether the font has a no-break hyphen or not (TX17: "state-of-the-art" 1388.3 twips with them and 1388.5 with hyphens).
|
||||
* it. Characters that take no room, and the hyphens, are as {@link specialWidthOf} says.
|
||||
*/
|
||||
const widthsOf = (font: Font, face: Face): readonly (number | undefined)[] => {
|
||||
const { widthOf } = readFont(fileOf(font, face));
|
||||
const key = keyOf(font.name, face);
|
||||
const word = WORD.find((reading) => reading.widths[key] !== undefined);
|
||||
if (word === undefined) {
|
||||
throw new Error(`None of Word's widths are of ${key}`);
|
||||
}
|
||||
const word = wordOf(key);
|
||||
/** The open font's width where it is Word's, or else Word's */
|
||||
const checked = (open: number | undefined, word: number): number =>
|
||||
open !== undefined && Math.abs(open - word) <= TOLERANCE ? open : Math.round(word);
|
||||
return CHARACTERS.map((code) => {
|
||||
const hex = code.toString(16).padStart(4, "0");
|
||||
if (/[\p{Mn}\p{Me}\p{Cf}]/u.test(String.fromCodePoint(code)) && code !== SOFT_HYPHEN) {
|
||||
return 0;
|
||||
}
|
||||
if (code === SOFT_HYPHEN || code === NO_BREAK_HYPHEN) {
|
||||
return (code === SOFT_HYPHEN ? widthOf(code) : undefined) ?? widthOf(HYPHEN);
|
||||
const special = specialWidthOf(code, widthOf);
|
||||
if (special !== undefined) {
|
||||
return special;
|
||||
}
|
||||
// Spaces are read from the space between letters, so Word's PDF reads them as they are
|
||||
const space = word.spaces[key]?.[hex];
|
||||
@@ -190,6 +284,92 @@ const widthsOf = (font: Font, face: Face): readonly (number | undefined)[] => {
|
||||
});
|
||||
};
|
||||
|
||||
// What Word's PDFs showed of Office's fonts that the tables don't follow, for the report printed at the end
|
||||
const report: string[] = [];
|
||||
|
||||
/**
|
||||
* The width of each character of a face of one of Office's fonts, from Word's own file of it, in thousandths of an em,
|
||||
* or undefined where the font doesn't have the character, which Word draws in another font, or for a face the font has
|
||||
* no file for, which Word makes itself. Word's PDF of the face is checked: Word draws each character the file has in
|
||||
* the font, as wide as the file has it, to within its reading, but for some of the spaces, which Word works out itself,
|
||||
* as it does Calibri's em space, 905 thousandths of an em where its file has 1000, and are Word's. Characters that take
|
||||
* no room, and the hyphens, are as {@link specialWidthOf} says.
|
||||
*/
|
||||
const officeWidthsOf = (font: OfficeFont, face: Face): readonly (number | undefined)[] | undefined => {
|
||||
const file = font.files[face];
|
||||
if (file === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
const { widthOf } = readFont(officeFileOf(file));
|
||||
const key = keyOf(font.name, face);
|
||||
const word = wordOf(key);
|
||||
const off: string[] = [];
|
||||
const elsewhere = new Map<string, number>();
|
||||
const widths = CHARACTERS.map((code) => {
|
||||
const hex = code.toString(16).padStart(4, "0");
|
||||
const special = specialWidthOf(code, widthOf);
|
||||
if (special !== undefined) {
|
||||
return special;
|
||||
}
|
||||
const own = widthOf(code);
|
||||
const space = word.spaces[key]?.[hex];
|
||||
if (space !== undefined) {
|
||||
return own !== undefined && Math.abs(own - space) > TOLERANCE ? Math.round(space) : own;
|
||||
}
|
||||
const drawn = word.widths[key][hex];
|
||||
if (own === undefined) {
|
||||
if (drawn?.font) {
|
||||
elsewhere.set(drawn.font, (elsewhere.get(drawn.font) ?? 0) + 1);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
if (drawn !== undefined && !isOwnFont(drawn.font, font.name)) {
|
||||
throw new Error(`Word drew ${hex} in ${drawn.font}, where ${font.name}'s file has it`);
|
||||
}
|
||||
if (drawn !== undefined && Math.abs(drawn.width - word.offset - own) > TOLERANCE) {
|
||||
off.push(`${hex} ${(drawn.width - word.offset - own).toFixed(1)}`);
|
||||
}
|
||||
return own;
|
||||
});
|
||||
report.push(
|
||||
`${key}: ${widths.filter((width) => width !== undefined).length} characters; Word's PDF reads ${off.length} of them otherwise` +
|
||||
`${off.length > 0 ? ` (${off.join(", ")})` : ""}; the rest Word draws in ${[...elsewhere]
|
||||
.sort(([, one], [, other]) => other - one)
|
||||
.map(([name, count]) => `${name} ${count}`)
|
||||
.join(", ")}`,
|
||||
);
|
||||
return widths;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks Word's PDF of a face of one of Office's fonts that it makes itself: an italic is as wide as the upright face,
|
||||
* and a bold, each character 18 thousandths of an em wider than the face it is made from, but for the spaces, which are as
|
||||
* wide as they are
|
||||
*/
|
||||
const checkMadeFace = (font: OfficeFont, face: Face): void => {
|
||||
const bold = face === "bold" || face === "boldItalic";
|
||||
const italic = face === "italic" || face === "boldItalic";
|
||||
// Word makes a bold for a font without one from its regular face, or its italic for bold italic, and an italic from
|
||||
// the upright face as bold as it
|
||||
const madeBold = bold && font.files.bold === undefined;
|
||||
const from: Face = madeBold ? (italic && font.files.italic !== undefined ? "italic" : "regular") : bold ? "bold" : "regular";
|
||||
const { widthOf } = readFont(officeFileOf(font.files[from]!));
|
||||
const key = keyOf(font.name, face);
|
||||
const word = wordOf(key);
|
||||
const differences = Object.entries(word.widths[key])
|
||||
.filter(([hex, { font: drawnIn }]) => isOwnFont(drawnIn, font.name) && widthOf(parseInt(hex, 16)) !== undefined)
|
||||
.map(([hex, { width }]) => width - word.offset - widthOf(parseInt(hex, 16))!)
|
||||
.sort((one, other) => one - other);
|
||||
const middle = differences[Math.floor(differences.length / 2)];
|
||||
const expected = madeBold ? 18 : 0;
|
||||
if (Math.abs(middle - expected) > TOLERANCE) {
|
||||
throw new Error(`Word's ${key} is ${middle.toFixed(2)} wider than ${font.name} ${from}, not ${expected}`);
|
||||
}
|
||||
report.push(
|
||||
`${key}: made by Word from ${from}, ${middle.toFixed(2)} thousandths of an em wider in the middle of ${differences.length} characters`,
|
||||
);
|
||||
};
|
||||
|
||||
// The digits of the widths, two to a width, from 0 to 4095 thousandths of an em
|
||||
const DIGITS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/";
|
||||
const CHARACTER_INDEX = new Map(CHARACTERS.map((code, index) => [code, index]));
|
||||
@@ -238,15 +418,48 @@ ${FACES.map((face) => ` ${face}: "${encode(widthsOf(font, face))}",`).joi
|
||||
},`;
|
||||
});
|
||||
|
||||
// Office's fonts, whose faces' files have the same hhea tables, so their lines are as tall as each other's too
|
||||
const officeEntries = OFFICE_FONTS.map((font) => {
|
||||
const heights = FACES.flatMap((face) => (font.files[face] === undefined ? [] : [hheaOf(officeFileOf(font.files[face]))]));
|
||||
const [{ lineHeight, descent }] = heights;
|
||||
if (heights.some((height) => height.lineHeight !== lineHeight || height.descent !== descent)) {
|
||||
throw new Error(`${font.name}'s faces' lines aren't as tall as each other`);
|
||||
}
|
||||
for (const [size, height] of Object.entries(HEIGHTS[font.name] ?? {})) {
|
||||
if (Math.abs(height - lineHeight) > TOLERANCE) {
|
||||
throw new Error(`Word's lines of ${font.name} ${size} are ${height}, not ${lineHeight}`);
|
||||
}
|
||||
}
|
||||
if (HEIGHTS[font.name] === undefined) {
|
||||
throw new Error(`Word's heights don't have ${font.name}`);
|
||||
}
|
||||
const faces = FACES.flatMap((face) => {
|
||||
const widths = officeWidthsOf(font, face);
|
||||
if (widths === undefined) {
|
||||
checkMadeFace(font, face);
|
||||
return [];
|
||||
}
|
||||
return [` ${face}: "${encode(widths)}",`];
|
||||
});
|
||||
return ` {
|
||||
name: "${font.name}",
|
||||
lineHeight: ${lineHeight},
|
||||
descent: ${descent},
|
||||
${faces.join("\n")}
|
||||
},`;
|
||||
});
|
||||
|
||||
writeFileSync(
|
||||
OUTPUT,
|
||||
`/**
|
||||
* How wide each character is in the fonts Word documents use most, and how tall a line of text is.
|
||||
* How wide each character is in the fonts Word documents use most, and in Office's other fonts that Word installs, and how
|
||||
* tall a line of text is.
|
||||
*
|
||||
* Generated by scripts/generate-font-widths.ts from fonts with an open license that have the same widths:
|
||||
* Carlito (Calibri), Caladea (Cambria), and Liberation Sans, Serif and Mono (Arial, Times New Roman and Courier New),
|
||||
* plain, bold, italic and bold italic, checked against Word's: Word's own widths where its PDFs show they differ, and none
|
||||
* where Word draws a character in another font, as its width isn't known. Do not edit by hand.
|
||||
* where Word draws a character in another font, as its width isn't known; and from Word's own files of Office's other
|
||||
* fonts, checked against Word's PDFs of every character of them, and of how tall their lines are. Do not edit by hand.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
@@ -272,12 +485,18 @@ export type FontWidths = {
|
||||
* known; and "*" with two digits repeats what is before it that many more times
|
||||
*/
|
||||
readonly regular: string;
|
||||
/** The same for bold text */
|
||||
readonly bold: string;
|
||||
/** The same for italic text */
|
||||
readonly italic: string;
|
||||
/** The same for bold italic text */
|
||||
readonly boldItalic: string;
|
||||
/**
|
||||
* The same for bold text, or none for a font without a bold face, such as Calibri Light, whose bold Word makes itself,
|
||||
* each character wider than the regular, which the tables don't follow yet
|
||||
*/
|
||||
readonly bold?: string;
|
||||
/**
|
||||
* The same for italic text, or none for a font without an italic face, such as Tahoma, whose italic Word slants from
|
||||
* the upright face, as wide as it
|
||||
*/
|
||||
readonly italic?: string;
|
||||
/** The same for bold italic text, or none for a font without a bold italic face, as for italic text */
|
||||
readonly boldItalic?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -291,9 +510,10 @@ ${RANGES.map(([first, last]) => ` [0x${first.toString(16)}, 0x${last.toString
|
||||
|
||||
/* cspell:disable */
|
||||
export const FONT_WIDTHS: readonly FontWidths[] = [
|
||||
${entries.join("\n")}
|
||||
${[...entries, ...officeEntries].join("\n")}
|
||||
];
|
||||
/* cspell:enable */
|
||||
`,
|
||||
);
|
||||
execSync(`npx prettier --write ${OUTPUT}`);
|
||||
console.log(report.join("\n"));
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Layout probes
|
||||
|
||||
<!-- cspell:ignore fsplit soffice Poppler pdftocairo autoSpace pdftohtml Aptos GPOS DFonts -->
|
||||
<!-- cspell:ignore fsplit soffice Poppler pdftocairo autoSpace pdftohtml Aptos GPOS DFonts hhea -->
|
||||
|
||||
Documents made to find out how Word lays out pages, where its rules aren't written down. docx/layout follows what they
|
||||
showed. Each line of text names its probe, such as `Q3a fill 12`, so it can be found in a PDF of the document, and each
|
||||
probe starts on a page of its own or is marked off by lines above and below it.
|
||||
|
||||
Each probe has the `.docx` Word opened and the PDF Word saved from it, beside the script that makes it. They were saved
|
||||
from Word 16 for Mac from 2026-09-30 to 2026-10-02 (Save As, PDF, Best for printing). docx writes some of them differently
|
||||
from Word 16 for Mac from 2026-09-30 to 2026-10-05 (Save As, PDF, Best for printing). docx writes some of them differently
|
||||
now, so the committed `.docx` is the one each PDF is of: `word-rules` and `word-tables` were made before docx wrote a
|
||||
table style and each cell's width.
|
||||
|
||||
@@ -86,6 +86,10 @@ table style and each cell's width.
|
||||
| `word-equations2` | EQ6 to EQ9: what `word-equations` left open: each italic letter, Latin and Greek, small and capital, before an operator, for its width and italic correction; plain letters, digits, binary operators, relations, brackets and punctuation; an italic letter before a digit or a plain letter, unary minus signs, normal text and a plain function's name; and how tall a line with an equation is in Arial, Times New Roman, Courier New and 16 points, alone in its paragraph, with space around it, and two in one `m:oMathPara` | `word-equations2.py` |
|
||||
| `fsplit` | How a footnote that doesn't fit below its reference goes on to the next page. Laid out in LibreOffice only, so it has no PDF from Word: Word's split of an 8-line footnote is `word-rules` P7b | `pagelines.py` |
|
||||
| `stops2/` | The stops batch of 2026-10-04 (lay-stops2): one probe document for each stop that needed Word, saved from Word in one session. Those a change has followed are committed, with what Word showed, in `stops2/README.md` | `stops2/word-stops.py` |
|
||||
| `word-stops-font-widths` | In `stops2`, from lay-stops2's batch: W, S, B and H, as `word-character-widths`, in Office's 16 other fonts that Word for Mac installs, from Calibri Light to Impact, plain and bold, and `word-stops-font-italic-widths` in italic and bold italic, with the bold and italic Word makes itself for a font without them. Word draws each character a font has as wide as its own file has it, and the rest in Calibri, Cambria, Arial, Times New Roman, Cambria Math, Segoe UI Symbol or an East Asian font, by the font and character. `scripts/generate-font-widths.ts` makes their width tables from Word's files, checked against what the reader reads | `word-character-widths.py` |
|
||||
| `word-stops-font-heights` | In `stops2`: FH1 to FH16, how tall a line of each of the 16 fonts is at 11 and 20 points, which is as their files' hhea tables make it, Corbel's and Book Antiqua's shorter than their ascent and descent for Windows make it. `word-stops-kerning.ts` writes it | `word-font-heights.py` |
|
||||
| `word-stops-font-kerning` | In `stops2`: I, K, L and P, as `word-kerning`, in Calibri Light, Aptos, Aptos Narrow, Georgia, Trebuchet MS and Verdana, and `word-stops-font-kerning2` in the other ten: Word kerns each as its own file does, and text with Normal's ligatures only where the file's GPOS table kerns Latin text. `scripts/generate-font-kerning.ts` makes their kerning from what the reader reads | `word-kerning.py` |
|
||||
| `word-stops-office-fonts` | In `stops2`: MB, FB, KL and DS, what lay2-fonts left stopping, for the next round of Word's PDFs: the bold Word makes itself at other sizes, kerned, and of an embedded font; whether the font Word draws a character a font lacks in depends on the run's language or East Asian font, and how tall its line is; kerning with other ligature settings in fonts kerned only by their kern table; and Corbel's and Consolas's descents | `word-stops-office-fonts.py` |
|
||||
|
||||
## Make a probe's `.docx`
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# The stops batch (lay-stops2)
|
||||
|
||||
<!-- cspell:ignore pdftocairo Poppler poppler -->
|
||||
<!-- cspell:ignore pdftocairo Poppler poppler hhea GPOS -->
|
||||
|
||||
Probe documents for the stops of docx/layout that no Word PDF saved before 2026-10-04 settled, made in one batch from
|
||||
docx at `master` a871df8a25 and saved from Word 16 for Mac on 2026-10-04 and 2026-10-05 (Save As, PDF, Best for
|
||||
@@ -15,11 +15,18 @@ committed here are the ones a change to docx/layout has followed, with Word's PD
|
||||
| `word-stops-tabs.ts` | TA1 to TA8, SH10 to SH15, JU1 to JU3 | TA8a to TA8h: a left tab stop past the end of the line takes a line of its own, and the text after it goes on the next |
|
||||
| `word-stops-vertical-cells.ts` | TV1 to TV6 | TV5d: a table in a cell whose text runs up, which stops the layout, and which a layout that guesses lays out |
|
||||
| `word-stops-equations.ts` | EQ10 to EQ28 | EQ27a to EQ27k: Word draws each character of an equation that Cambria Math has as wide as the font has it, the Greek variants as italic letters, but for the integrals, which it draws wider, and ◇, which it draws in another font |
|
||||
| `word-stops-font-widths.ts` | W, S, B, H | W, S: each of Office's 16 other fonts as wide as Word's own file of it; an italic Word slants as wide as upright. `STOPS_ITALIC=1` writes the italics. Read with `../word-character-widths.py` |
|
||||
| `word-stops-font-kerning.ts` | I, K, L, P, R, SP | K, L, P: kerned as each font's file kerns it; with ligatures, only where its GPOS table kerns Latin. `STOPS_SET=2` writes the second half. Read with `../word-kerning.py` |
|
||||
| `word-stops-kerning.ts` | KE1 to KE8, FH1 to FH16 | FH1 to FH16 (`word-stops-font-heights`): each of the 16 fonts' lines as tall as its file's hhea table makes it. Read with `word-font-heights.py` |
|
||||
|
||||
`word-stops-edges.ts` has the cases around those, where docx/layout still stops (DH2, PB9, HR2 and TA9), for the next
|
||||
batch Word saves: it has no PDF from Word yet. `word-equation-characters.py` reads EQ27's widths from Word's PDF, for
|
||||
`scripts/generate-equation-widths.ts`.
|
||||
|
||||
`word-stops-office-fonts.ts` has what the font probes left stopping (MB, FB, KL and DS), for the next batch too: the bold
|
||||
Word makes itself at other sizes, the font Word draws a character a font lacks in, kerning with other ligature settings in
|
||||
fonts kerned by their kern table alone, and descents. Read Word's PDF of it with `word-stops-office-fonts.py`.
|
||||
|
||||
`kit.ts` is what the scripts share: the page (A4, inch margins, Calibri 11 single spaced, 51 lines a page), labelled
|
||||
lines, and the injections that write what docx can't, such as hidden or deleted paragraph marks, in the schema's order.
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Reads FH1 to FH16 of word-stops-font-heights.docx (word-stops-kerning.ts writes it) from a PDF of it: how tall a line of
|
||||
# each of Office's fonts is, single spaced, at 11 and 20 points, from where Word puts its 30 lines of 11 points and 20 of
|
||||
# 20 points, over the lines of each on the same page.
|
||||
#
|
||||
# pdftotext -bbox-layout word-stops-font-heights.pdf word-stops-font-heights.html
|
||||
# python3 word-font-heights.py word-stops-font-heights [--json]
|
||||
#
|
||||
# It takes the name of the PDF without its extension, and reads the file above beside it. Heights are in points, and in
|
||||
# thousandths of an em. With --json, it prints them as JSON, which scripts/generate-font-widths.ts takes: each font's
|
||||
# height of a line, in thousandths of an em, at each size.
|
||||
# cspell:ignore bbox
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
base = sys.argv[1]
|
||||
text = open(base + ".html", encoding="utf8").read()
|
||||
LINE = re.compile(r"^FH(\d+) (.+) (11|20) line (\d+)$")
|
||||
|
||||
# The bottom of each line of each font and size, by page: pdftotext puts it the same distance below the baseline of
|
||||
# every line of the same font and size
|
||||
bottoms = {}
|
||||
fonts = {}
|
||||
for page, content in enumerate(re.findall(r"<page.*?</page>", text, re.S), 1):
|
||||
for bottom, words in re.findall(r'<line xMin="[\d.]+" yMin="[\d.]+" xMax="[\d.]+" yMax="([\d.]+)">(.*?)</line>', content, re.S):
|
||||
found = LINE.match(" ".join(html.unescape(word) for word in re.findall(r">([^<]*)</word>", words)))
|
||||
if found:
|
||||
number, font, size = int(found.group(1)), found.group(2), int(found.group(3))
|
||||
fonts[number] = font
|
||||
bottoms.setdefault((number, size), {}).setdefault(page, []).append(float(bottom))
|
||||
|
||||
heights = {}
|
||||
for (number, size), pages in sorted(bottoms.items()):
|
||||
# Each page's lines are as far apart as the line is tall
|
||||
span = sum(max(lines) - min(lines) for lines in pages.values())
|
||||
gaps = sum(len(lines) - 1 for lines in pages.values())
|
||||
heights.setdefault(fonts[number], {})[str(size)] = round(span / gaps / size * 1000, 2)
|
||||
|
||||
if "--json" in sys.argv:
|
||||
print(json.dumps({"heights": heights}, ensure_ascii=False, separators=(",", ":"), sort_keys=True))
|
||||
sys.exit()
|
||||
|
||||
print("== FH: the height of a line of each font, in thousandths of an em, at 11 and 20 points")
|
||||
for number, font in sorted(fonts.items()):
|
||||
sizes = heights[font]
|
||||
print(f" FH{number:<3} {font:22} " + " ".join(f"{size} points: {sizes[size]:8.2f}" for size in ("11", "20")))
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,433 @@
|
||||
// lay-stops2: how Word kerns text and joins ligatures in Office's fonts that Word for Mac installs, which docx/layout's
|
||||
// width tables don't have ("kerned text in a font whose kerning isn't known", "ligatures in a font whose ligatures aren't
|
||||
// known"): every document made from Word's Normal template kerns its text from 1 point, so Calibri Light's headings, and
|
||||
// Aptos's text since Word 365 made it the default, are kerned. #3661 found Word kerns Aptos tighter than its font file's
|
||||
// GPOS and kern tables say on 3% of words, so the kerning comes from Word's own PDF, as for the tables' fonts.
|
||||
// Made from scripts/layout-probes/word-kerning.ts with its fonts changed: I, K, L (Normal's ligatures and all) and P for
|
||||
// each face of the fonts, and R and SP as there. Read Word's PDF with word-kerning.py, which reads the .json beside it.
|
||||
//
|
||||
// It writes word-stops-font-kerning.docx: Calibri Light, Aptos, Aptos Narrow, Georgia, Trebuchet MS and Verdana; and with
|
||||
// STOPS_SET=2, word-stops-font-kerning2.docx: Century Gothic, Consolas, Candara, Corbel, Constantia, Book Antiqua, Gill Sans
|
||||
// MT, Franklin Gothic Book, Tahoma and Impact.
|
||||
//
|
||||
// Usage: npm run run-ts -- scripts/layout-probes/stops2/word-stops-font-kerning.ts [folder]
|
||||
/**
|
||||
* Probes of how Word kerns text and joins ligatures in the fonts of the width tables, and in Aptos, for docx/layout's
|
||||
* kerning (`w:kern`) and ligatures (`w14:ligatures`), which Word's own Normal template turns on: kerning from 1 point,
|
||||
* and standard and contextual ligatures. Open the document in Word and save it as a PDF beside it, and read the PDF with
|
||||
* word-kerning.py, which reads where Word draws each glyph.
|
||||
*
|
||||
* Its pages are 22 inches square, the largest Word has, with margins of half an inch, so a paragraph is one line of up to
|
||||
* 1,512 points. Each paragraph is one line, in 10 points, and word-kerning.json, beside the document, has the text of
|
||||
* each in order, for the reader. The lines of each probe come after a line naming it, such as "K3 Calibri italic".
|
||||
*
|
||||
* I: each character of Windows-1252, apart, in each face of the probes, so the reader knows the glyph Word draws for each
|
||||
* K: every pair of the characters of Windows-1252 (WinAnsi, the characters of most text in Western European languages:
|
||||
* printable ASCII, Latin-1 and 27 more, such as curly quotes, dashes and €), kerned from 1 point, in Calibri, Cambria,
|
||||
* Arial and Times New Roman, plain, bold, italic and bold italic, and every pair of printable ASCII in Courier New.
|
||||
* The characters follow each other so that each pair is next to each other once (a de Bruijn sequence), so a pair's
|
||||
* kerning is how much nearer Word draws its second character than the first's width
|
||||
* L: words of two and three characters that a font could join, each after a space, not kerned, in each face of Calibri,
|
||||
* Cambria and Times New Roman, with each ligature setting Word's Font dialog writes: standard ligatures only, standard
|
||||
* and contextual (Normal's), historical and discretional, and all; and in Arial and Courier New with all. The words are
|
||||
* "f" and "t", and for the discretional settings "T", "c", "ç", "s" and "i", each followed by each character, and "ff",
|
||||
* "tt", "ft" and "tf" each followed by each character
|
||||
* LK: the kerning beside the glyphs of joined letters: each of the ligatures Carlito, as wide as Calibri, joins, and those
|
||||
* of Cambria and Times New Roman, before and after each character, and before each other, kerned from 1 point, with
|
||||
* standard and contextual ligatures, and with all for discretional ones
|
||||
* A: L's words in Aptos, plain and bold, kerned from 1 point with Normal's ligatures, and with all, for measuring fonts
|
||||
* from their files, and lines of prose in Aptos with Normal's settings
|
||||
* P: lines of prose with Normal's settings in each font of the width tables, and in Calibri bold and italic, for where
|
||||
* Word puts each word
|
||||
* R: kerning and ligatures across runs: letters in runs that differ only in their colour or their language, and a word
|
||||
* split into runs that are the same, in Calibri 11
|
||||
* SP: kerning and ligatures with space between the characters, characters drawn wider, and small capitals, in Calibri 11
|
||||
*
|
||||
* Word's PDF, saved from Word 16 for Mac on 2026-10-02 (word-kerning.pdf, beside it), showed:
|
||||
* K: Word kerns every face but Courier New, which it kerns not at all, as the open fonts as wide as them do, Carlito and
|
||||
* Liberation Sans and Serif, to within a thousandth of an em, but for a few characters its own fonts kern otherwise,
|
||||
* such as Calibri's ƒ, Calibri Bold's apostrophe and Calibri Italic's æ. Arial and Times New Roman kern an A, L, P, T,
|
||||
* V, W or Y with the space beside it. Cambria kerns ten times the pairs Caladea does, and draws its regular face's
|
||||
* letters with accents, kerned, as the letter and the accent, each a glyph. Word draws a hyphen, en dash, no-break
|
||||
* space, ™ and backslash, and an à in kerned text, up to 25 thousandths of an em from where their widths and kerning
|
||||
* put them, and the text after them with them, in text kerned or not, so the pairs before them aren't read
|
||||
* L: Calibri joins ff, fi, fl, ffi, ffl, ft, tt, tti, ti and the rest of its standard ligatures with standard ligatures,
|
||||
* standard and contextual, and all; and ch, ck, ct, st and ij with historical and discretional, and all. Times New Roman
|
||||
* joins fi, fl, ff, ffi, ffl, fj, ffj and Th only with discretional ligatures. Cambria draws an f before some letters
|
||||
* another way, as wide, and Arial and Courier New join nothing
|
||||
* LK: Word kerns the glyphs Calibri's ligatures make as Carlito kerns its own, to within a thousandth of an em for 98.8%
|
||||
* of the pairs read, and those off are off as the pairs before the characters it moves are
|
||||
* A: Aptos joins ff, fi and fl with Normal's ligatures, and fj too with all, as its GSUB table has them
|
||||
* P: the width tables, kerned and with Normal's ligatures, put each word where Word does, to within 0.25 points across a
|
||||
* line of 1,300, in Calibri, Arial and Times New Roman
|
||||
* R: Word kerns letters across runs of other colours (R1c), and joins them across runs (R2c, R2d), but doesn't kern them
|
||||
* across runs of other languages (R1d)
|
||||
* SP: Word joins no letters in text with a point between its characters, or half a point taken away, but kerns it (SP1,
|
||||
* SP2); kerns and joins letters drawn wider (SP3); and kerns the small capitals of small capitals, but not a capital
|
||||
* with the small capital after it (SP4)
|
||||
*
|
||||
* Usage: npm run run-ts -- scripts/layout-probes/word-kerning.ts, which writes build/word-probes/word-kerning.docx and
|
||||
* word-kerning.json
|
||||
*/
|
||||
// cspell:ignore bbox Carlito WinAnsi Aptos Caladea GSUB GPOS
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
|
||||
import JSZip from "jszip";
|
||||
|
||||
import { Document, Packer, Paragraph, type ParagraphChild, TextRun } from "docx";
|
||||
|
||||
import { measureTextWidth } from "../../../src/text-layout/text-width";
|
||||
|
||||
const range = (first: number, last: number): readonly number[] => Array.from({ length: last - first + 1 }, (_, index) => first + index);
|
||||
|
||||
// The characters Windows-1252 has besides printable ASCII and Latin-1, in its bytes 0x80 to 0x9F
|
||||
const WINDOWS_1252_MORE = [
|
||||
0x20ac, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x017d, 0x2018, 0x2019, 0x201c, 0x201d,
|
||||
0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x017e, 0x0178,
|
||||
];
|
||||
// The characters of Windows-1252, with the space and the no-break space, less the soft hyphen, which Word doesn't draw
|
||||
const WINDOWS_1252 = [...range(0x20, 0x7e), ...range(0xa0, 0xff).filter((code) => code !== 0xad), ...WINDOWS_1252_MORE]
|
||||
.sort((one, other) => one - other)
|
||||
.map((code) => String.fromCodePoint(code));
|
||||
const ASCII = range(0x20, 0x7e).map((code) => String.fromCodePoint(code));
|
||||
|
||||
type Face = { readonly font: string; readonly bold: boolean; readonly italic: boolean };
|
||||
const facesOf = (font: string): readonly Face[] =>
|
||||
[
|
||||
[false, false],
|
||||
[true, false],
|
||||
[false, true],
|
||||
[true, true],
|
||||
].map(([bold, italic]) => ({ font, bold, italic }));
|
||||
const nameOf = ({ font, bold, italic }: Face): string => `${font}${bold ? " bold" : ""}${italic ? " italic" : ""}`;
|
||||
|
||||
// The ligature settings of Word's Font dialog, as w14:ligatures writes them
|
||||
const STANDARD_SETTINGS = ["standard", "standardContextual"] as const;
|
||||
const DISCRETIONAL_SETTINGS = ["historicalDiscretional", "all"] as const;
|
||||
type Setting = (typeof STANDARD_SETTINGS)[number] | (typeof DISCRETIONAL_SETTINGS)[number];
|
||||
|
||||
// Points, and the width of a line, in points: 22 inches less half an inch on each side
|
||||
const SIZE = 10;
|
||||
const PAGE = 22 * 1440;
|
||||
const MARGIN = 720;
|
||||
const LINE = (PAGE - 2 * MARGIN) / 20;
|
||||
// How much of a line a paragraph fills, measured without kerning or ligatures, so that each is one line in Word
|
||||
const FILL = 0.9;
|
||||
|
||||
/**
|
||||
* A sequence of the characters in which each pair of them, the same character twice too, is next to each other once: a
|
||||
* de Bruijn sequence of order 2, with its first character again at its end.
|
||||
*/
|
||||
const everyPair = (characters: readonly string[]): readonly string[] => {
|
||||
const count = characters.length;
|
||||
const sequence: number[] = [];
|
||||
const digits = [0, 0, 0];
|
||||
const build = (at: number, period: number): void => {
|
||||
if (at > 2) {
|
||||
if (2 % period === 0) {
|
||||
sequence.push(...digits.slice(1, period + 1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
digits[at] = digits[at - period];
|
||||
build(at + 1, period);
|
||||
for (let digit = digits[at - period] + 1; digit < count; digit++) {
|
||||
digits[at] = digit;
|
||||
build(at + 1, at);
|
||||
}
|
||||
};
|
||||
build(1, 1);
|
||||
return [...sequence, sequence[0]].map((index) => characters[index]);
|
||||
};
|
||||
|
||||
/** Splits characters into lines that fill a line, each starting with the character the line before ends with */
|
||||
const linesOf = (characters: readonly string[], face: Face): readonly string[] => {
|
||||
const lines: string[] = [];
|
||||
let start = 0;
|
||||
while (start < characters.length - 1) {
|
||||
let end = start + 1;
|
||||
let width = measureTextWidth(characters[start], { ...face, size: SIZE });
|
||||
while (end < characters.length && width + measureTextWidth(characters[end], { ...face, size: SIZE }) < LINE * FILL) {
|
||||
width += measureTextWidth(characters[end], { ...face, size: SIZE });
|
||||
end += 1;
|
||||
}
|
||||
lines.push(characters.slice(start, end).join(""));
|
||||
start = end - 1;
|
||||
}
|
||||
return lines;
|
||||
};
|
||||
|
||||
/** Words, each after a space, in lines that fill a line */
|
||||
const wordLines = (words: readonly string[], face: Face): readonly string[] =>
|
||||
words.reduce<readonly string[]>((lines, word) => {
|
||||
const last = lines[lines.length - 1];
|
||||
return last !== undefined && measureTextWidth(`${last} ${word}`, { ...face, size: SIZE }) < LINE * FILL
|
||||
? [...lines.slice(0, -1), `${last} ${word}`]
|
||||
: [...lines, ` ${word}`];
|
||||
}, []);
|
||||
|
||||
// The words of L: the letters fonts join after, each followed by each character, and the pairs of them followed by each
|
||||
const STANDARD_STARTS = ["f", "t", "ff", "tt", "ft", "tf"];
|
||||
const DISCRETIONAL_STARTS = [...STANDARD_STARTS, "T", "c", "ç", "s", "i"];
|
||||
const wordsAfter = (starts: readonly string[]): readonly string[] =>
|
||||
starts.flatMap((start) => WINDOWS_1252.map((character) => `${start}${character}`));
|
||||
|
||||
// The joined letters of LK: Carlito's standard ligatures of the characters of Windows-1252, and its discretional ones,
|
||||
// which Calibri's are, and the letters Cambria and Times New Roman may join
|
||||
const ACCENTED_I = ["ì", "í", "î", "ï"];
|
||||
const CALIBRI_STANDARD = [
|
||||
..."ff fi fl ffi ffl ft fft tt tti ttf ti tf fb fh fk fj ffb ffh ffk ffj".split(" "),
|
||||
...["f", "ff", "t", "tt"].flatMap((start) => ACCENTED_I.map((letter) => `${start}${letter}`)),
|
||||
];
|
||||
const CALIBRI_DISCRETIONAL = "ch ck ct çt ij st".split(" ");
|
||||
const CAMBRIA_STANDARD = ["ff", "fi", "fl", "ffi", "ffl", "fb", "fh", "fk", "fj", "ft", ...ACCENTED_I.map((letter) => `f${letter}`)];
|
||||
const TIMES_DISCRETIONAL = "ff fi fl ffi ffl fj ffj Th".split(" ");
|
||||
/** The words of LK for joined letters: after each character, before each, and before each of the others */
|
||||
const besideEach = (joined: readonly string[]): readonly string[] =>
|
||||
joined.flatMap((letters) => [
|
||||
...WINDOWS_1252.map((character) => `${letters}${character}`),
|
||||
...WINDOWS_1252.map((character) => `${character}${letters}`),
|
||||
...joined.map((other) => `${letters}${other}`),
|
||||
]);
|
||||
|
||||
/** A paragraph of the probes, for the reader: what is in it, in which face, kerned or not, and with which ligatures */
|
||||
type Line = {
|
||||
readonly probe: string;
|
||||
readonly face: Face;
|
||||
readonly size: number;
|
||||
readonly kerned: boolean;
|
||||
readonly ligatures?: Setting;
|
||||
readonly text: string;
|
||||
};
|
||||
|
||||
const lines: Line[] = [];
|
||||
const paragraphs: Paragraph[] = [];
|
||||
|
||||
/**
|
||||
* Ligatures are written as a language that this script replaces with them (see `main`), as docx doesn't write them. The
|
||||
* language is the last of a run's properties, where w14:ligatures goes
|
||||
*/
|
||||
const ligatureRun = (setting: Setting | undefined): { readonly language?: { readonly value: string } } =>
|
||||
setting === undefined ? {} : { language: { value: `x-ligatures-${setting}` } };
|
||||
|
||||
const add = (line: Line): void => {
|
||||
lines.push(line);
|
||||
const { face, size, kerned, ligatures, text } = line;
|
||||
paragraphs.push(
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({
|
||||
text,
|
||||
font: face.font,
|
||||
size: size * 2,
|
||||
bold: face.bold,
|
||||
italics: face.italic,
|
||||
...(kerned ? { kern: 2 } : {}),
|
||||
...ligatureRun(ligatures),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
const LABEL_FACE: Face = { font: "Calibri", bold: false, italic: false };
|
||||
const label = (text: string): void => add({ probe: "label", face: LABEL_FACE, size: SIZE, kerned: false, text });
|
||||
|
||||
// I1 to I24: each character of Windows-1252 in each face of the probes, apart, not kerned and with no ligatures, so the
|
||||
// reader knows each character's glyph
|
||||
// The faces of Office's fonts that Word for Mac installs, which docx/layout's tables don't have: each font's own faces
|
||||
const SECOND = process.env.STOPS_SET === "2";
|
||||
const NEW_FACES: readonly Face[] = SECOND
|
||||
? [
|
||||
...["Century Gothic", "Consolas", "Candara", "Corbel", "Constantia", "Book Antiqua", "Gill Sans MT"].flatMap((font) =>
|
||||
facesOf(font),
|
||||
),
|
||||
...["Franklin Gothic Book"].flatMap((font) => facesOf(font).filter(({ bold }) => !bold)),
|
||||
...["Tahoma"].flatMap((font) => facesOf(font).filter(({ italic }) => !italic)),
|
||||
{ font: "Impact", bold: false, italic: false },
|
||||
]
|
||||
: [
|
||||
...["Calibri Light"].flatMap((font) => facesOf(font).filter(({ bold }) => !bold)),
|
||||
...["Aptos", "Aptos Narrow", "Georgia", "Trebuchet MS", "Verdana"].flatMap((font) => facesOf(font)),
|
||||
];
|
||||
const NAME = SECOND ? "word-stops-font-kerning2" : "word-stops-font-kerning";
|
||||
const FACES = NEW_FACES;
|
||||
const APTOS_FACES: readonly Face[] = [];
|
||||
[...FACES, ...APTOS_FACES].forEach((face, index) => {
|
||||
label(`I${index + 1} ${nameOf(face)}`);
|
||||
// The space is the one between them
|
||||
for (const text of wordLines(WINDOWS_1252.slice(1), face)) {
|
||||
add({ probe: `I${index + 1}`, face, size: SIZE, kerned: false, text });
|
||||
}
|
||||
});
|
||||
|
||||
// K1 to K20
|
||||
const KERNED = [...NEW_FACES.map((face) => ({ face, characters: WINDOWS_1252 }))];
|
||||
KERNED.forEach(({ face, characters }, index) => {
|
||||
label(`K${index + 1} ${nameOf(face)}`);
|
||||
for (const text of linesOf(everyPair(characters), face)) {
|
||||
add({ probe: `K${index + 1}`, face, size: SIZE, kerned: true, text });
|
||||
}
|
||||
});
|
||||
|
||||
// L1 to L56
|
||||
const JOINED: readonly { readonly face: Face; readonly setting: Setting }[] = [
|
||||
...NEW_FACES.flatMap((face) => [
|
||||
{ face, setting: "standardContextual" as const },
|
||||
{ face, setting: "all" as const },
|
||||
]),
|
||||
];
|
||||
JOINED.forEach(({ face, setting }, index) => {
|
||||
label(`L${index + 1} ${nameOf(face)} ${setting}`);
|
||||
const words = wordsAfter((STANDARD_SETTINGS as readonly string[]).includes(setting) ? STANDARD_STARTS : DISCRETIONAL_STARTS);
|
||||
for (const text of wordLines(words, face)) {
|
||||
add({ probe: `L${index + 1}`, face, size: SIZE, kerned: false, ligatures: setting, text });
|
||||
}
|
||||
});
|
||||
|
||||
// LK1 to LK16
|
||||
const BESIDE: readonly { readonly face: Face; readonly setting: Setting; readonly joined: readonly string[] }[] = [];
|
||||
BESIDE.forEach(({ face, setting, joined }, index) => {
|
||||
label(`LK${index + 1} ${nameOf(face)} ${setting}`);
|
||||
for (const text of wordLines(besideEach(joined), face)) {
|
||||
add({ probe: `LK${index + 1}`, face, size: SIZE, kerned: true, ligatures: setting, text });
|
||||
}
|
||||
});
|
||||
|
||||
// A1 to A4, and A5, prose
|
||||
const APTOS: readonly { readonly face: Face; readonly setting: Setting }[] = [];
|
||||
APTOS.forEach(({ face, setting }, index) => {
|
||||
label(`A${index + 1} ${nameOf(face)} ${setting}`);
|
||||
const words = wordsAfter(setting === "all" ? DISCRETIONAL_STARTS : STANDARD_STARTS);
|
||||
for (const text of wordLines(words, face)) {
|
||||
add({ probe: `A${index + 1}`, face, size: SIZE, kerned: true, ligatures: setting, text });
|
||||
}
|
||||
});
|
||||
const PROSE =
|
||||
"The official staff of the office offered fifty different affiliations after the first stiff fight; with difficulty " +
|
||||
"they flew to Tiffany's fjord, effectively fitting the attitude of affluent artists who fill the coffee shop at night. ";
|
||||
|
||||
// P1 to P7: prose with Normal's settings, kerned from 1 point with standard and contextual ligatures, in each font, and
|
||||
// in Calibri bold and italic, for where Word puts each word
|
||||
const STORY =
|
||||
"“To Wyatt’s office,” Avery wrote — fifty-five affluent officials flew to Tyrone’s fjord at 7:45; Yvonne’s staff " +
|
||||
"offered “efficient” coffee, attitude & difficult afflictions (Vol. VII, p. 14). L’Atelier’s AVANT-GARDE “Façade” " +
|
||||
"kept 98.6% of the WAVY yellow awnings; Tom’s P.T.A. took Ty, Wa and Yo to the “Fjord-Café” for 3½ hours. ";
|
||||
const PROSE_FACES: readonly Face[] = [...NEW_FACES.filter(({ bold, italic }) => !bold && !italic)];
|
||||
PROSE_FACES.forEach((face, index) => {
|
||||
label(`P${index + 1} ${nameOf(face)}`);
|
||||
for (const text of wordLines(STORY.repeat(12).trim().split(" "), face).slice(0, 8)) {
|
||||
add({ probe: `P${index + 1}`, face, size: SIZE, kerned: true, ligatures: "standardContextual", text: text.trimStart() });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* R and SP: probes of a few runs each, on letter-sized pages in Calibri 11, each line's first word naming it. The reader
|
||||
* reads the width of the word after the name.
|
||||
*/
|
||||
type Piece = { readonly text: string } & Readonly<Record<string, unknown>>;
|
||||
const CALIBRI_11 = { font: "Calibri", size: 22 };
|
||||
const small: { readonly name: string; readonly pieces: readonly Piece[]; readonly kerned: boolean; readonly ligatures?: Setting }[] = [];
|
||||
const probe = (name: string, pieces: readonly Piece[], kerned: boolean, ligatures?: Setting): void => {
|
||||
small.push({ name, pieces, kerned, ligatures });
|
||||
};
|
||||
const KERN_WORD = "ToToToToToToToToToTo";
|
||||
const LIGATURE_WORD = "officialofficialofficial";
|
||||
const alternate = (text: string, other: Readonly<Record<string, unknown>>): readonly Piece[] =>
|
||||
[...text].map((letter, index) => (index % 2 === 0 ? { text: letter } : { text: letter, ...other }));
|
||||
// R1: kerning between letters in runs of other colours, and of other languages, against one run, kerned and not
|
||||
probe("R1a", [{ text: KERN_WORD }], false);
|
||||
probe("R1b", [{ text: KERN_WORD }], true);
|
||||
probe("R1c", alternate(KERN_WORD, { color: "C00000" }), true);
|
||||
probe("R1d", alternate(KERN_WORD, { language: { value: "fr-FR" } }), true);
|
||||
probe("R1e", alternate(KERN_WORD, {}), true);
|
||||
// R2: ligatures across runs: "official" split after "of" in runs that are the same, of another colour, of another language
|
||||
probe("R2a", [{ text: LIGATURE_WORD }], false);
|
||||
probe("R2b", [{ text: LIGATURE_WORD }], false, "standardContextual");
|
||||
const splitWord = (other: Readonly<Record<string, unknown>>): readonly Piece[] =>
|
||||
LIGATURE_WORD.split("official").flatMap((part, index) => (index === 0 ? [] : [{ text: "of" }, { text: "ficial", ...other }]));
|
||||
probe("R2c", splitWord({}), false, "standardContextual");
|
||||
probe("R2d", splitWord({ color: "C00000" }), false, "standardContextual");
|
||||
// SP1: kerning and ligatures with a point between the characters, and with half a point taken away
|
||||
for (const [name, spacing] of [
|
||||
["SP1", 20],
|
||||
["SP2", -10],
|
||||
] as const) {
|
||||
probe(`${name}a`, [{ text: KERN_WORD, characterSpacing: spacing }], false);
|
||||
probe(`${name}b`, [{ text: KERN_WORD, characterSpacing: spacing }], true);
|
||||
probe(`${name}c`, [{ text: LIGATURE_WORD, characterSpacing: spacing }], false);
|
||||
probe(`${name}d`, [{ text: LIGATURE_WORD, characterSpacing: spacing }], false, "standardContextual");
|
||||
}
|
||||
// SP3: characters drawn half as wide again
|
||||
probe("SP3a", [{ text: KERN_WORD, scale: 150 }], false);
|
||||
probe("SP3b", [{ text: KERN_WORD, scale: 150 }], true);
|
||||
probe("SP3c", [{ text: LIGATURE_WORD, scale: 150 }], false);
|
||||
probe("SP3d", [{ text: LIGATURE_WORD, scale: 150 }], false, "standardContextual");
|
||||
// SP4: small capitals, whose capitals are kerned with the small ones, or not
|
||||
probe("SP4a", [{ text: "TodayTodayTodayToday", smallCaps: true }], false);
|
||||
probe("SP4b", [{ text: "TodayTodayTodayToday", smallCaps: true }], true);
|
||||
probe("SP4c", [{ text: LIGATURE_WORD, smallCaps: true }], false, "standardContextual");
|
||||
probe("SP4d", [{ text: LIGATURE_WORD, smallCaps: true }], false);
|
||||
|
||||
const smallParagraphs = small.map(
|
||||
({ name, pieces, kerned, ligatures }) =>
|
||||
new Paragraph({
|
||||
children: [
|
||||
// The probe's name is a word of its own, not kerned and with no ligatures, so the word after it is boxed alone
|
||||
new TextRun({ ...CALIBRI_11, text: `${name} ` }),
|
||||
...pieces.map(
|
||||
(piece): ParagraphChild =>
|
||||
new TextRun({
|
||||
...CALIBRI_11,
|
||||
...piece,
|
||||
...(kerned ? { kern: 2 } : {}),
|
||||
...(ligatures === undefined ? {} : ligatureRun(ligatures)),
|
||||
}),
|
||||
),
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
const doc = new Document({
|
||||
styles: {
|
||||
default: { document: { run: { font: "Calibri", size: SIZE * 2 }, paragraph: { spacing: { before: 0, after: 0, line: 240 } } } },
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
properties: {
|
||||
page: { size: { width: PAGE, height: PAGE }, margin: { top: MARGIN, right: MARGIN, bottom: MARGIN, left: MARGIN } },
|
||||
},
|
||||
children: paragraphs,
|
||||
},
|
||||
{ children: smallParagraphs },
|
||||
],
|
||||
});
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const zip = await JSZip.loadAsync(await Packer.toBuffer(doc));
|
||||
// Ligatures, written as a language, at the end of the run's properties, as their schema has them
|
||||
const xml = (await zip.file("word/document.xml")!.async("string")).replace(
|
||||
/<w:lang w:val="x-ligatures-(\w+)"\/>/g,
|
||||
'<w14:ligatures w14:val="$1"/>',
|
||||
);
|
||||
zip.file("word/document.xml", xml);
|
||||
const OUT = process.argv[2] ?? "build/word-stops";
|
||||
mkdirSync(OUT, { recursive: true });
|
||||
writeFileSync(`${OUT}/${NAME}.docx`, await zip.generateAsync({ type: "nodebuffer", compression: "DEFLATE" }));
|
||||
// Each line as [its probe, its face's name, whether it is kerned, its ligatures or "", its text]
|
||||
const sidecar = {
|
||||
size: SIZE,
|
||||
characters: WINDOWS_1252.join(""),
|
||||
lines: lines.map(({ probe, face, kerned, ligatures, text }) => [probe, nameOf(face), kerned, ligatures ?? "", text]),
|
||||
small: small.map(({ name, pieces, kerned, ligatures }) => [name, pieces.map(({ text }) => text).join(""), kerned, ligatures ?? ""]),
|
||||
};
|
||||
writeFileSync(`${OUT}/${NAME}.json`, `${JSON.stringify(sidecar)}\n`);
|
||||
const count = (probe: string): number =>
|
||||
lines.filter((line) => line.probe.replace(/\d+$/, "") === probe).reduce((total, line) => total + [...line.text].length, 0);
|
||||
console.log(
|
||||
`${lines.length} lines: K ${count("K")} characters, L ${count("L")}, LK ${count("LK")}, A ${count("A")}, P ${count("P")}; ` +
|
||||
`${small.length} small probes`,
|
||||
);
|
||||
};
|
||||
|
||||
void main();
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,271 @@
|
||||
// lay-stops2: the widths of the characters of the width tables' ranges in Office's fonts that Word for Mac installs, which docx/layout stops at ("a font not in the width tables"), plain and bold, and italic and bold italic. Calibri Light is the heading font of every document made from Word 2013 to 2019's Normal template: 3 of the 5 Word templates in demo/assets, and 6 docx demos, stop at it. A face a font lacks, such as Calibri Light Bold, shows the bold or italic Word makes itself
|
||||
// Made from scripts/layout-probes/word-character-widths.ts, with its fonts changed; read Word's PDF with
|
||||
// word-character-widths.py, which reads the .json written beside the document. With STOPS_ITALIC=1 it writes the italic
|
||||
// and bold italic faces.
|
||||
//
|
||||
// Usage: npm run run-ts -- scripts/layout-probes/stops2/word-stops-font-widths.ts [folder]; STOPS_ITALIC=1 for italics
|
||||
// Probes of how wide Word draws the characters of the width tables' ranges, in each of the five fonts the tables have,
|
||||
// plain and bold, or italic and bold italic, and of how lines break after the spaces other than U+0020. Each paragraph's first word names its probe,
|
||||
// so it can be found in a PDF saved from Word with pdftotext. Open the document in Word and save it as a PDF beside it.
|
||||
// Read the PDF with word-character-widths.py.
|
||||
//
|
||||
// W: every character of the ranges that is drawn, ten times over as one word, in 10-point Calibri, Cambria, Arial, Times
|
||||
// New Roman and Courier New, plain and bold, 16 characters to a paragraph, each after its code point, such as u0391,
|
||||
// in 6-point Calibri. A word's width over ten is the character's, and the font it is drawn in shows whether the font
|
||||
// has it, or Word draws it in another
|
||||
// S: each space, and the characters that take no room, ten times between eleven H's, after ten H's in a word of their own,
|
||||
// in each font: the space's width is what the eleven H's and ten spaces take, less eleven H's
|
||||
// B: forty words joined by each space, in Calibri 11: whether Word breaks lines after it, so each line ends with a whole word
|
||||
// H: a line whose last word ends half the space's width before the margin, with the space after it: whether the word stays
|
||||
// on the line, as it does before a U+0020, which hangs past the margin, or goes to the next line with the space
|
||||
//
|
||||
// The fonts, and the spaces and words of S, B and H, are written in word-character-widths.json, beside the document, for
|
||||
// the reader.
|
||||
//
|
||||
// With "italic", it writes word-italic-widths.docx and word-italic-widths.json: W and S in italic and bold italic, in the
|
||||
// same paragraphs, numbered the same way. B and H are left out, as where lines break after a space doesn't depend on the face.
|
||||
//
|
||||
// Word's PDF, saved from Word 16 for Mac on 2026-10-02, showed:
|
||||
// W: the open fonts' widths are Word's, to within a thousandth of an em, for all but a few characters: Calibri's ƒ and ɪ,
|
||||
// Cambria's arrows, primes and some symbols, Arial's and Times New Roman's superscript and subscript digits, and some
|
||||
// of Arial Bold's Cyrillic. Word's Cambria has the Greek, Cyrillic and Latin Extended-B that Caladea lacks. Word draws
|
||||
// most mathematical symbols and letterlike symbols in Cambria Math, and others in Segoe UI Symbol, MS Gothic and other
|
||||
// fonts, when the font lacks them. It drew three lines of Courier New squeezed, with Ž to Ƌ, ˙ to ˝ and Ͻ to Ђ on them
|
||||
// S: Calibri's en, em, three-per-em, four-per-em and six-per-em spaces are 498, 905, 301, 226 and 151 thousandths of an
|
||||
// em, where Carlito's are 500, 1000, 335, 250 and 167, and Arial's en space is 556, where Liberation Sans' is 500. The
|
||||
// zero-width characters take no room
|
||||
// B and H: lines break after en, em and four-per-em spaces, which Word has as spaces of its own, and ideographic spaces,
|
||||
// and the word before one at the end of a line stays on it, as before a U+0020. Word joins the words around the other
|
||||
// spaces, as it does around a no-break space, but splits a run of words joined by six-per-em spaces that is longer than
|
||||
// a line at one of them
|
||||
//
|
||||
// Word's PDF of word-italic-widths, saved from Word 16 for Mac on 2026-10-02, showed:
|
||||
// W: the open fonts' italics and bold italics are Word's, to within a thousandth of an em, for all but a few characters, as
|
||||
// upright: Calibri's ƒ and ɪ, Cambria's arrows, primes, some symbols and, in bold italic, its accents, Arial's and Times
|
||||
// New Roman's superscript and subscript digits, and a few of Arial's Cyrillic. Calibri's italic т is drawn as an m, 791
|
||||
// thousandths of an em, where the upright one is 387, as Carlito's is. Word draws what the italics lack in other fonts,
|
||||
// as upright, such as the arrows ↖ to ↙ in Apple Color Emoji, whose boxes pdftotext puts off their line. It drew most of
|
||||
// Cambria's italic arrows and mathematical symbols with no text, as it drew Cambria Bold's, so their widths can't be read
|
||||
// S: the spaces are as wide as upright, but for Times New Roman italic's em, three-per-em, four-per-em and six-per-em
|
||||
// spaces, which are 889, 297, 222 and 149 thousandths of an em, where the upright ones are 1000, 333, 250 and 167
|
||||
//
|
||||
// Usage: npm run run-ts -- scripts/layout-probes/word-character-widths.ts [italic], which writes
|
||||
// build/word-probes/word-character-widths.docx, or word-italic-widths.docx with "italic"
|
||||
// cspell:ignore bbox Caladea Aptos
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
|
||||
import { Document, Packer, Paragraph, TextRun } from "docx";
|
||||
|
||||
import { measureTextWidth } from "../../../src/text-layout/text-width";
|
||||
|
||||
// The ranges of the width tables: printable ASCII; Latin-1, Latin Extended-A and B, IPA and the spacing modifier letters;
|
||||
// Greek and Cyrillic; Latin Extended Additional, for Vietnamese; and general punctuation, superscripts and subscripts,
|
||||
// currency symbols, letterlike symbols, number forms, arrows and mathematical operators
|
||||
const RANGES = [
|
||||
[0x20, 0x7e],
|
||||
[0xa0, 0x2ff],
|
||||
[0x370, 0x4ff],
|
||||
[0x1e00, 0x1eff],
|
||||
[0x2000, 0x22ff],
|
||||
] as const;
|
||||
|
||||
const FONTS = [
|
||||
"Calibri Light",
|
||||
"Aptos",
|
||||
"Aptos Narrow",
|
||||
"Trebuchet MS",
|
||||
"Georgia",
|
||||
"Verdana",
|
||||
"Tahoma",
|
||||
"Century Gothic",
|
||||
"Consolas",
|
||||
"Candara",
|
||||
"Corbel",
|
||||
"Constantia",
|
||||
"Book Antiqua",
|
||||
"Franklin Gothic Book",
|
||||
"Gill Sans MT",
|
||||
"Impact",
|
||||
] as const;
|
||||
const ITALIC = process.env.STOPS_ITALIC === "1";
|
||||
const NAME = ITALIC ? "word-stops-font-italic-widths" : "word-stops-font-widths";
|
||||
const FACES = FONTS.flatMap((font) => [false, true].map((bold) => (ITALIC ? { font, bold, italic: true } : { font, bold })));
|
||||
|
||||
// Points, and how many times each character is written in its word
|
||||
const SIZE = 10;
|
||||
const COPIES = 10;
|
||||
const PER_PARAGRAPH = 16;
|
||||
// The size of the code point written before each character's word, small to save room
|
||||
const LABEL_SIZE = 6;
|
||||
|
||||
// Characters that are drawn: not spaces, marks, which go on the character before them, formatting characters, or code
|
||||
// points that aren't characters
|
||||
const isDrawn = (code: number): boolean => !/[\p{C}\p{Z}\p{M}]/u.test(String.fromCodePoint(code));
|
||||
const DRAWN = RANGES.flatMap(([first, last]) => Array.from({ length: last - first + 1 }, (_, index) => first + index)).filter(isDrawn);
|
||||
|
||||
// The spaces, and the characters that take no room, between H's
|
||||
const SPACES = [
|
||||
0x20, 0xa0, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x202f, 0x205f, 0x3000, 0x200b,
|
||||
0x200c, 0x200d, 0x200e, 0x200f, 0x2060,
|
||||
];
|
||||
// The spaces lines may break after
|
||||
const BREAKS = [0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x202f, 0x205f, 0x3000];
|
||||
|
||||
const WORDS = "the survey of the coast was made in the summer by boat and on foot from the lighthouse to the river mouth".split(" ");
|
||||
const prose = (count: number): readonly string[] => Array.from({ length: count }, (_, i) => WORDS[(i * 7) % WORDS.length]);
|
||||
|
||||
const hex = (code: number): string => code.toString(16).padStart(4, "0");
|
||||
const label = (text: string): TextRun => new TextRun({ text: `${text} `, font: "Calibri", size: SIZE * 2 });
|
||||
|
||||
// Calibri 11, in which B and H are, and the width of its lines on A4 with margins of an inch, in twips
|
||||
const CALIBRI = { font: "Calibri", size: 11 };
|
||||
const LINE = 11906 - 2 * 1440;
|
||||
const twips = (text: string): number => measureTextWidth(text, CALIBRI) * 20;
|
||||
// Calibri's widths of the spaces, in thousandths of an em, from Carlito, and Word's for the en and em spaces (word-watertight-text
|
||||
// TX19a and TX19b): half of one is how far before the margin H's last word ends
|
||||
const SPACE_WIDTHS: Readonly<Record<number, number>> = {
|
||||
0x20: 226,
|
||||
0x2000: 500,
|
||||
0x2001: 1000,
|
||||
0x2002: 498,
|
||||
0x2003: 905,
|
||||
0x2004: 335,
|
||||
0x2005: 250,
|
||||
0x2006: 167,
|
||||
0x2007: 539,
|
||||
0x2008: 217,
|
||||
0x2009: 200,
|
||||
0x200a: 125,
|
||||
0x202f: 226,
|
||||
0x205f: 222,
|
||||
0x3000: 1000,
|
||||
};
|
||||
|
||||
/**
|
||||
* A word as wide as `width` twips in Calibri 11, to within a twip, from letters of different widths.
|
||||
*/
|
||||
const wordOfWidth = (width: number): string => {
|
||||
const letters = [..."eoirtfsc"];
|
||||
const widths = letters.map(twips);
|
||||
let best = { word: "", error: Infinity };
|
||||
const search = (index: number, word: string, total: number): void => {
|
||||
if (Math.abs(width - total) < best.error) {
|
||||
best = { word, error: Math.abs(width - total) };
|
||||
}
|
||||
if (index === letters.length || total > width) {
|
||||
return;
|
||||
}
|
||||
for (let count = 0; count <= 4; count++) {
|
||||
search(index + 1, word + letters[index].repeat(count), total + count * widths[index]);
|
||||
}
|
||||
};
|
||||
search(0, "", 0);
|
||||
return best.word;
|
||||
};
|
||||
|
||||
// The characters of each paragraph of W, which are the same in each face
|
||||
const PARAGRAPHS = Array.from({ length: Math.ceil(DRAWN.length / PER_PARAGRAPH) }, (_, index) =>
|
||||
DRAWN.slice(index * PER_PARAGRAPH, (index + 1) * PER_PARAGRAPH),
|
||||
);
|
||||
const BREAK_WORDS = prose(40);
|
||||
|
||||
// A face's bold and italic, as a run writes them
|
||||
const runFace = ({
|
||||
bold,
|
||||
italic,
|
||||
}: {
|
||||
readonly bold: boolean;
|
||||
readonly italic?: boolean;
|
||||
}): { readonly bold: boolean; readonly italics?: boolean } => (italic ? { bold, italics: true } : { bold });
|
||||
|
||||
// W1 to W1250: the paragraphs of characters in each face in turn, the first face's first
|
||||
const widthParagraphs = FACES.flatMap(({ font, ...face }, faceIndex) =>
|
||||
PARAGRAPHS.map(
|
||||
(codes, index) =>
|
||||
new Paragraph({
|
||||
children: [
|
||||
label(`W${faceIndex * PARAGRAPHS.length + index + 1}`),
|
||||
...codes.flatMap((code) => [
|
||||
new TextRun({ text: `u${hex(code)}`, font: "Calibri", size: LABEL_SIZE * 2 }),
|
||||
// The spaces around the word are in its font, so they are wide enough for pdftotext to part the words
|
||||
new TextRun({ text: ` ${String.fromCodePoint(code).repeat(COPIES)} `, font, ...runFace(face), size: SIZE * 2 }),
|
||||
]),
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
// S1 to S220: each space in each face in turn
|
||||
const spaceParagraphs = FACES.flatMap(({ font, ...face }, faceIndex) =>
|
||||
SPACES.map(
|
||||
(code, index) =>
|
||||
new Paragraph({
|
||||
children: [
|
||||
label(`S${faceIndex * SPACES.length + index + 1}`),
|
||||
new TextRun({
|
||||
text: `${"H".repeat(COPIES)} H${`${String.fromCodePoint(code)}H`.repeat(COPIES)}`,
|
||||
font,
|
||||
...runFace(face),
|
||||
size: SIZE * 2,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
// B1 to B14: each space lines may break after
|
||||
const breakParagraphs = BREAKS.map(
|
||||
(code, index) => new Paragraph({ children: [new TextRun(`B${index + 1} ${BREAK_WORDS.join(String.fromCodePoint(code))}`)] }),
|
||||
);
|
||||
|
||||
// H1 to H15: U+0020, and each space lines may break after
|
||||
const HANGS = [0x20, ...BREAKS].map((code, index) => {
|
||||
const name = `H${index + 1}`;
|
||||
// The word ends half the space's width before the margin
|
||||
const end = LINE - (SPACE_WIDTHS[code] * 220) / 1000 / 2;
|
||||
const filler = prose(40).reduce((text, word) => (twips(`${text} ${word} `) < end - 600 ? `${text} ${word}` : text), name);
|
||||
const word = wordOfWidth(end - twips(`${filler} `));
|
||||
return { code, filler, word, end, after: prose(12).join(" ") };
|
||||
});
|
||||
const hangParagraphs = HANGS.map(
|
||||
({ code, filler, word, after }) => new Paragraph({ children: [new TextRun(`${filler} ${word}${String.fromCodePoint(code)}${after}`)] }),
|
||||
);
|
||||
|
||||
const doc = new Document({
|
||||
styles: {
|
||||
default: { document: { run: { font: "Calibri", size: 22 }, paragraph: { spacing: { before: 0, after: 0, line: 240 } } } },
|
||||
},
|
||||
sections: [
|
||||
{ children: widthParagraphs },
|
||||
{ children: spaceParagraphs },
|
||||
...(ITALIC ? [] : [{ children: [...breakParagraphs, ...hangParagraphs] }]),
|
||||
],
|
||||
});
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const OUT = process.argv[2] ?? "build/word-stops";
|
||||
mkdirSync(OUT, { recursive: true });
|
||||
writeFileSync(`${OUT}/${NAME}.docx`, await Packer.toBuffer(doc));
|
||||
const sidecar = {
|
||||
size: SIZE,
|
||||
copies: COPIES,
|
||||
faces: FACES,
|
||||
paragraphs: PARAGRAPHS,
|
||||
spaces: SPACES,
|
||||
breaks: ITALIC ? { codes: [], words: [] } : { codes: BREAKS, words: BREAK_WORDS },
|
||||
hangs: ITALIC ? [] : HANGS.map(({ code, word, end }) => ({ code, word, end })),
|
||||
};
|
||||
writeFileSync(`${OUT}/${NAME}.json`, `${JSON.stringify(sidecar)}\n`);
|
||||
console.log(`${DRAWN.length} characters in each of ${FACES.length} faces, in ${widthParagraphs.length} paragraphs`);
|
||||
if (ITALIC) {
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
HANGS.map(
|
||||
({ code, word, end, filler }, index) =>
|
||||
`H${index + 1} ${hex(code)} ${word} ends at ${end.toFixed(1)}, ${(end - twips(`${filler} ${word}`)).toFixed(2)} off`,
|
||||
).join("\n"),
|
||||
);
|
||||
};
|
||||
|
||||
void main();
|
||||
@@ -0,0 +1,172 @@
|
||||
/**
|
||||
* Probes of kerning, ligatures and OpenType features docx/layout stops at, after `word-kerning.docx` (I, K, L, LK, A, P,
|
||||
* R, SP), and of the line heights of Office's fonts that the width tables don't have.
|
||||
*
|
||||
* word-stops-kerning.docx, Calibri 11 kerned from 1 point (w:kern 2) unless it says, each line "KEna ..." between a line
|
||||
* above and below, so where each word ends shows its width:
|
||||
* KE1a to KE1c: kerned Greek (a), Cyrillic (b) and Latin Extended-A (c) pairs in Calibri, ten capital pairs each, such as
|
||||
* "ΤΑ ΥΑ ΓΑ" ("kerned text with a character whose kerning isn't known")
|
||||
* KE2a to KE2l: "official affluent fifty attitude fjord Th ct st" with each ligature setting the Font dialog doesn't
|
||||
* write: none, contextual, historical, discretional, standardHistorical, contextualHistorical, standardDiscretional,
|
||||
* contextualDiscretional, standardContextualHistorical, standardContextualDiscretional, standardHistoricalDiscretional
|
||||
* and contextualHistoricalDiscretional ("ligatures of a setting not yet followed")
|
||||
* KE3: Normal's ligatures (standardContextual) before accented letters, digits and punctuation: "fié ffé fi1 fi. fi, ffl'"
|
||||
* ("ligatures beside a character not yet followed")
|
||||
* KE4a to KE4j: "A-V A–V A V A™V A\V" in Cambria kerned, after 0 to 9 words, so it is at ten places along the line
|
||||
* ("kerning of a pair of characters not yet followed": #3661 found Word moves these by where they are in the line)
|
||||
* KE4k to KE4t: the same not kerned
|
||||
* KE5: kerning beside joined letters in Cambria: "Tfi Yffi Vffl fiT ffiV" kerned with Normal's ligatures ("kerning beside a ligature
|
||||
* not yet followed")
|
||||
* KE6a, KE6b: a word longer than its line, kerned: "AVAV..." of 120 letters (a), and with ligatures: "officeoffice..." of
|
||||
* 20 times (b) ("a word longer than its line, kerned or with ligatures")
|
||||
* KE7a to KE7l: digits "0123456789 1111111111 0000000000" in Calibri, Cambria and Aptos, with each of lining and old-style
|
||||
* figures (w14:numForm) and proportional and tabular spacing (w14:numSpacing) ("OpenType number forms or spacing")
|
||||
* KE8a to KE8c: stylistic set 1 (w14:stylisticSets) in Calibri and Gabriola, and contextual alternates (w14:cntxtAlts) in
|
||||
* Gabriola ("OpenType stylistic sets or contextual alternates")
|
||||
*
|
||||
* word-stops-font-heights.docx: FH1 to FH16, each of the fonts of word-stops-font-widths: 30 lines of 11 points, then
|
||||
* 20 of 20 points, single spaced, between a line above and below, for each font's line height
|
||||
*
|
||||
* Usage: npm run run-ts -- scripts/layout-probes/stops2/word-stops-kerning.ts [folder]
|
||||
*/
|
||||
// cspell:ignore Yffi Vffl AVAV Aptos
|
||||
import { Paragraph, TextRun } from "docx";
|
||||
|
||||
import { type Child, PAGE, group, line, marker, newPage, prose, write } from "./kit";
|
||||
|
||||
const KERNED = { kern: 2 } as const;
|
||||
const kerned = (text: string, run: object = {}): Paragraph => new Paragraph({ children: [new TextRun({ text, ...KERNED, ...run })] });
|
||||
|
||||
const LIGATURE_SETTINGS = [
|
||||
"none",
|
||||
"contextual",
|
||||
"historical",
|
||||
"discretional",
|
||||
"standardHistorical",
|
||||
"contextualHistorical",
|
||||
"standardDiscretional",
|
||||
"contextualDiscretional",
|
||||
"standardContextualHistorical",
|
||||
"standardContextualDiscretional",
|
||||
"standardHistoricalDiscretional",
|
||||
"contextualHistoricalDiscretional",
|
||||
] as const;
|
||||
const LIGATURE_WORDS = "official affluent fifty attitude fjord Th ct st office ffl";
|
||||
|
||||
const FIGURES = "0123456789 1111111111 0000000000 1.5 10,000";
|
||||
const FONTS = ["Calibri", "Cambria", "Aptos"] as const;
|
||||
const FORMS = [
|
||||
["lining", "proportional"],
|
||||
["lining", "tabular"],
|
||||
["oldStyle", "proportional"],
|
||||
["oldStyle", "tabular"],
|
||||
] as const;
|
||||
|
||||
const letters = "abcdefghijklmnopqrstuvwxyz";
|
||||
const children: Child[] = [
|
||||
...group("KE1a", [kerned("KE1a ΤΑ ΥΑ ΓΑ ΡΑ ΤΟ ΥΟ ΑΤ ΑΥ ΑΓ ΛΑ end")]),
|
||||
...group("KE1b", [kerned("KE1b ТА ГА РА УА ТО ГО АТ АУ ЛА ДА end")]),
|
||||
...group("KE1c", [kerned("KE1c ŤA ŸA ŔA ĽA ŦO ŤŐ AŤ AŸ ŁA ĹA end")]),
|
||||
...LIGATURE_SETTINGS.flatMap((setting, index) =>
|
||||
group(`KE2${letters[index]}`, [
|
||||
new Paragraph({ children: [new TextRun(`KE2${letters[index]} `), marker(`LIG_${setting}`), new TextRun(" end")] }),
|
||||
]),
|
||||
),
|
||||
...group("KE3", [new Paragraph({ children: [new TextRun("KE3 "), marker("LIG_standardContextual_KE3"), new TextRun(" end")] })]),
|
||||
newPage(),
|
||||
...Array.from({ length: 10 }, (_, index) =>
|
||||
group(`KE4${letters[index]}`, [kerned(`KE4${letters[index]} ${prose(index)} A-V A–V A V A™V A\\V end`, { font: "Cambria" })]),
|
||||
).flat(),
|
||||
...Array.from({ length: 10 }, (_, index) =>
|
||||
group(`KE4${letters[index + 10]}`, [
|
||||
line(`KE4${letters[index + 10]} ${prose(index)} A-V A–V A V A™V A\\V end`, {}, { font: "Cambria" }),
|
||||
]),
|
||||
).flat(),
|
||||
newPage(),
|
||||
...group("KE5", [new Paragraph({ children: [new TextRun("KE5 "), marker("LIG_standardContextual_KE5"), new TextRun(" end")] })]),
|
||||
...group("KE6a", [kerned(`KE6a ${"AV".repeat(60)} end`)]),
|
||||
...group("KE6b", [new Paragraph({ children: [new TextRun("KE6b "), marker("LIG_standardContextual_KE6b"), new TextRun(" end")] })]),
|
||||
newPage(),
|
||||
...FONTS.flatMap((font, fontIndex) =>
|
||||
FORMS.flatMap(([form, spacing], index) => {
|
||||
const name = `KE7${letters[fontIndex * 4 + index]}`;
|
||||
return group(name, [
|
||||
new Paragraph({
|
||||
children: [new TextRun(`${name} `), marker(`NUM_${form}_${spacing}_${font.replace(" ", "")}`), new TextRun(" end")],
|
||||
}),
|
||||
]);
|
||||
}),
|
||||
),
|
||||
...group("KE8a", [new Paragraph({ children: [new TextRun("KE8a "), marker("SS_Calibri"), new TextRun(" end")] })]),
|
||||
...group("KE8b", [new Paragraph({ children: [new TextRun("KE8b "), marker("SS_Gabriola"), new TextRun(" end")] })]),
|
||||
...group("KE8c", [new Paragraph({ children: [new TextRun("KE8c "), marker("CTX_Gabriola"), new TextRun(" end")] })]),
|
||||
];
|
||||
|
||||
const ligatureRun = (setting: string, text: string, kern = false, font = ""): string =>
|
||||
`<w:r><w:rPr>${font ? `<w:rFonts w:ascii="${font}" w:hAnsi="${font}"/>` : ""}${kern ? '<w:kern w:val="2"/>' : ""}<w14:ligatures w14:val="${setting}"/></w:rPr><w:t xml:space="preserve">${text}</w:t></w:r>`;
|
||||
|
||||
await write({
|
||||
name: "word-stops-kerning",
|
||||
sections: [{ properties: PAGE, children }],
|
||||
injections: [
|
||||
(parts) => {
|
||||
let text = parts.get("word/document.xml")!;
|
||||
const run = (name: string, xml: string): void => {
|
||||
text = text.replace(`<w:r><w:t xml:space="preserve">@@${name}@@</w:t></w:r>`, xml);
|
||||
};
|
||||
for (const setting of LIGATURE_SETTINGS) {
|
||||
run(`LIG_${setting}`, ligatureRun(setting, LIGATURE_WORDS));
|
||||
}
|
||||
run("LIG_standardContextual_KE3", ligatureRun("standardContextual", "fié ffé fi1 fi. fi, ffl' fiā"));
|
||||
run("LIG_standardContextual_KE5", ligatureRun("standardContextual", "Tfi Yffi Vffl fiT ffiV ffT fi- ffi–", true, "Cambria"));
|
||||
run("LIG_standardContextual_KE6b", ligatureRun("standardContextual", "office".repeat(20)));
|
||||
for (const font of FONTS) {
|
||||
for (const [form, spacing] of FORMS) {
|
||||
run(
|
||||
`NUM_${form}_${spacing}_${font}`,
|
||||
`<w:r><w:rPr><w:rFonts w:ascii="${font}" w:hAnsi="${font}"/><w14:numForm w14:val="${form}"/><w14:numSpacing w14:val="${spacing}"/></w:rPr><w:t xml:space="preserve">${FIGURES}</w:t></w:r>`,
|
||||
);
|
||||
}
|
||||
}
|
||||
run(
|
||||
"SS_Calibri",
|
||||
'<w:r><w:rPr><w14:stylisticSets><w14:styleSet w14:id="1"/></w14:stylisticSets></w:rPr><w:t xml:space="preserve">Stylistic set one: a g y 0 1 & Q</w:t></w:r>',
|
||||
);
|
||||
run(
|
||||
"SS_Gabriola",
|
||||
'<w:r><w:rPr><w:rFonts w:ascii="Gabriola" w:hAnsi="Gabriola"/><w14:stylisticSets><w14:styleSet w14:id="1"/></w14:stylisticSets></w:rPr><w:t xml:space="preserve">Stylistic set one: the survey of the coast</w:t></w:r>',
|
||||
);
|
||||
run(
|
||||
"CTX_Gabriola",
|
||||
'<w:r><w:rPr><w:rFonts w:ascii="Gabriola" w:hAnsi="Gabriola"/><w14:cntxtAlts/></w:rPr><w:t xml:space="preserve">Contextual alternates: the survey of the coast</w:t></w:r>',
|
||||
);
|
||||
parts.set("word/document.xml", text);
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const HEIGHT_FONTS = [
|
||||
"Calibri Light",
|
||||
"Aptos",
|
||||
"Aptos Narrow",
|
||||
"Trebuchet MS",
|
||||
"Georgia",
|
||||
"Verdana",
|
||||
"Tahoma",
|
||||
"Century Gothic",
|
||||
"Consolas",
|
||||
"Candara",
|
||||
"Corbel",
|
||||
"Constantia",
|
||||
"Book Antiqua",
|
||||
"Franklin Gothic Book",
|
||||
"Gill Sans MT",
|
||||
"Impact",
|
||||
];
|
||||
const heights: Child[] = HEIGHT_FONTS.flatMap((font, index) => [
|
||||
line(`FH${index + 1} above`, { pageBreakBefore: true }),
|
||||
...Array.from({ length: 30 }, (_, row) => line(`FH${index + 1} ${font} 11 line ${row + 1}`, {}, { font, size: 22 })),
|
||||
...Array.from({ length: 20 }, (_, row) => line(`FH${index + 1} ${font} 20 line ${row + 1}`, {}, { font, size: 40 })),
|
||||
line(`FH${index + 1} below`),
|
||||
]);
|
||||
await write({ name: "word-stops-font-heights", sections: [{ properties: PAGE, children: heights }] });
|
||||
@@ -0,0 +1,156 @@
|
||||
# Reads the probes of word-stops-office-fonts.ts from a PDF of it, and prints what each shows.
|
||||
#
|
||||
# pdftotext -bbox-layout word-stops-office-fonts.pdf word-stops-office-fonts.html
|
||||
# pdftohtml -xml -i -q -zoom 1 word-stops-office-fonts.pdf word-stops-office-fonts
|
||||
# python3 word-stops-office-fonts.py word-stops-office-fonts
|
||||
#
|
||||
# It takes the name of the PDF without its extension, and reads the files above beside it, and the .json the probe's
|
||||
# script writes beside the document. Widths are in thousandths of an em of the text's size, and heights in points.
|
||||
#
|
||||
# MB1, MB4: each character's width, from a word of ten H's and one of ten i's, and the space's, from ten H's apart, bold
|
||||
# and not: the bold Word makes is as much wider at each size, in thousandths of an em, as the 18 at 10 points if it is
|
||||
# of an em, or 18 at 10 points and less at larger sizes if it is of a point
|
||||
# MB2: where each word starts, bold and not, kerned with Normal's ligatures, in points from the first
|
||||
# MB3, FB2: how tall each run of lines is, from where pdftotext puts their bottoms
|
||||
# FB1: the font Word drew each word of ten characters in, and its width, in each language
|
||||
# KL1: the width of "ToToToToTo", "AVAVAVAVAV" and "WaWaWaWaWa" with each ligature setting, kerned: less than without kerning
|
||||
# where Word kerns them
|
||||
# KL2: where each word of the line of Verdana starts, in points from the first
|
||||
# DS1, DS2: how far apart the probe's lines are, which is how tall each is
|
||||
# cspell:ignore bbox pdftohtml fontspec
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
base = sys.argv[1]
|
||||
probe = json.load(open(base + ".json", encoding="utf8"))
|
||||
text = open(base + ".html", encoding="utf8").read()
|
||||
xml = open(base + ".xml", encoding="utf8").read()
|
||||
|
||||
# Each line: page, bottom, and its words (left, right, text), in points, in order
|
||||
lines = []
|
||||
for page, content in enumerate(re.findall(r"<page.*?</page>", text, re.S), 1):
|
||||
for bottom, words in re.findall(r'<line xMin="[\d.]+" yMin="[\d.]+" xMax="[\d.]+" yMax="([\d.]+)">(.*?)</line>', content, re.S):
|
||||
found = [
|
||||
(float(x0), float(x1), html.unescape(word))
|
||||
for x0, x1, word in re.findall(r'<word xMin="([\d.]+)" yMin="[\d.]+" xMax="([\d.]+)" yMax="[\d.]+">([^<]*)</word>', words)
|
||||
]
|
||||
lines.append((page, float(bottom), found))
|
||||
|
||||
# The font of each piece of text pdftohtml found, by page: (top, left, right) in points
|
||||
families = dict(re.findall(r'<fontspec id="(\d+)" size="[^"]*" family="([^"]*)"', xml))
|
||||
pieces = {}
|
||||
for page, content in re.findall(r'<page number="(\d+)".*?>(.*?)</page>', xml, re.S):
|
||||
for top, left, width, font in re.findall(r'<text top="(-?\d+)" left="(-?\d+)" width="(\d+)" height="\d+" font="(\d+)"', content):
|
||||
pieces.setdefault(int(page), []).append((int(top), int(left), int(left) + int(width), families[font].split("+")[-1]))
|
||||
|
||||
|
||||
def font_at(page, bottom, left, right):
|
||||
middle = (left + right) / 2
|
||||
found = [name for top, start, end, name in pieces.get(page, []) if top <= bottom + 2 and bottom - top < 80 and start - 1 <= middle <= end + 1]
|
||||
return found[-1] if found else None
|
||||
|
||||
|
||||
# Each word of each page: (page, top, bottom, left, right, text), in points
|
||||
words_of_pages = []
|
||||
for page, content in enumerate(re.findall(r"<page.*?</page>", text, re.S), 1):
|
||||
for x0, y0, x1, y1, word in re.findall(r'<word xMin="([\d.]+)" yMin="([\d.]+)" xMax="([\d.]+)" yMax="([\d.]+)">([^<]*)</word>', content):
|
||||
words_of_pages.append((page, float(y0), float(y1), float(x0), float(x1), html.unescape(word)))
|
||||
|
||||
|
||||
def line_of(*start):
|
||||
"""The words of the line whose first words are these: the words level with them, from left to right, to "end", as
|
||||
(left, right, text). pdftotext puts words of other sizes beside them on lines of their own, so the line is made again
|
||||
from the words whose boxes are level with the first word's"""
|
||||
for index, (page, top, bottom, left, right, word) in enumerate(words_of_pages):
|
||||
if word != start[0]:
|
||||
continue
|
||||
level = sorted(
|
||||
(other for other in words_of_pages if other[0] == page and other[3] >= left and other[1] < bottom and other[2] > top),
|
||||
key=lambda other: other[3],
|
||||
)
|
||||
texts = [other[5] for other in level]
|
||||
if texts[: len(start)] != list(start):
|
||||
continue
|
||||
found = []
|
||||
for other in level:
|
||||
found.append((other[3], other[4], other[5]))
|
||||
if other[5] == "end":
|
||||
break
|
||||
return (page, bottom, found)
|
||||
return None
|
||||
|
||||
|
||||
def words_after(line, count):
|
||||
"""The words of a line after its probe's name and how it is written"""
|
||||
return line[2][2 : 2 + count]
|
||||
|
||||
|
||||
print("== MB1, MB4: widths of H, i and the space, bold and not, in thousandths of an em")
|
||||
widths = {}
|
||||
for name, font, size, how in probe["measured"]:
|
||||
if not name.startswith("MB"):
|
||||
continue
|
||||
copies = probe["copies"].get(str(size), 10)
|
||||
em = size / 1000
|
||||
found = {kind: line_of(name, font.replace(" ", "_"), how, kind) for kind in ("H", "i", "space")}
|
||||
if any(line is None for line in found.values()):
|
||||
print(f" {name} {font} {size} {how}: not found")
|
||||
continue
|
||||
h = (found["H"][2][4][1] - found["H"][2][4][0]) / copies / em
|
||||
i = (found["i"][2][4][1] - found["i"][2][4][0]) / copies / em
|
||||
spaced = found["space"][2][4 : 4 + copies]
|
||||
space = ((spaced[-1][0] - spaced[0][0]) - (copies - 1) * (spaced[0][1] - spaced[0][0])) / (copies - 1) / em
|
||||
widths[(name, font, how)] = (h, i, space)
|
||||
if how == "regular" and (name, font, "bold") in widths:
|
||||
bold = widths[(name, font, "bold")]
|
||||
print(
|
||||
f" {name} {font:22} {size:3} points: H {bold[0]:7.2f} bold, {h:7.2f}, {bold[0] - h:+6.2f}; "
|
||||
f"i {bold[1] - i:+6.2f}; space {bold[2]:6.2f} bold, {space:6.2f}"
|
||||
)
|
||||
|
||||
print("\n== MB2: where each word starts, kerned with Normal's ligatures, in points")
|
||||
for index in range(3):
|
||||
name = f"MB2{'abc'[index]}"
|
||||
for how in ("bold", "regular"):
|
||||
line = line_of(name, how)
|
||||
if line:
|
||||
starts = [round(left - line[2][2][0], 2) for left, _, _ in line[2][2:-1]]
|
||||
print(f" {name} {how:8} {starts}")
|
||||
|
||||
print("\n== MB3, FB2: the height of the lines of each run, in points")
|
||||
runs = {}
|
||||
for page, bottom, words in lines:
|
||||
found = re.match(r"^((?:MB3|FB2)[a-z]) (.+) line \d+(?: (with|without).*)?$", " ".join(word for _, _, word in words))
|
||||
if found:
|
||||
key = (found.group(1), found.group(2), found.group(3))
|
||||
runs.setdefault(key, {}).setdefault(page, []).append(bottom)
|
||||
for (name, label, which), pages in runs.items():
|
||||
gaps = sum(len(bottoms) - 1 for bottoms in pages.values())
|
||||
if gaps > 0:
|
||||
height = sum(max(bottoms) - min(bottoms) for bottoms in pages.values()) / gaps
|
||||
print(f" {name} {label} {which or ''}: {height:.4f}")
|
||||
|
||||
print("\n== FB1: the font Word drew each word in, and its width, in each language")
|
||||
for page, bottom, words in lines:
|
||||
if words and re.match(r"^FB1[a-z]$", words[0][2]) and len(words) >= 3 and words[1][2] not in ("above", "below"):
|
||||
left, right, word = words[2]
|
||||
print(f" {words[0][2]} {words[1][2]:10} {word[:1]} in {font_at(page, bottom, left, right)}, {right - left:.2f} points")
|
||||
|
||||
print("\n== KL1: widths of the kerned pairs with each ligature setting, in points")
|
||||
for name, font, size, setting in probe["measured"]:
|
||||
if name.startswith("KL1"):
|
||||
line = line_of(name, setting)
|
||||
if line:
|
||||
print(f" {name} {font:22} {setting:24} " + " ".join(f"{right - left:7.3f}" for left, right, _ in words_after(line, 3)))
|
||||
|
||||
print("\n== KL2: where each word of the line of Verdana starts, in points")
|
||||
line = line_of("KL2", probe["prose"].split(" ")[0])
|
||||
if line:
|
||||
print(" " + str([round(left - line[2][1][0], 2) for left, _, _ in line[2][1:-1]]))
|
||||
|
||||
print("\n== DS1, DS2: how far apart the probe's lines are, in points")
|
||||
for name in ("DS1a", "DS1b", "DS2a", "DS2b"):
|
||||
bottoms = [bottom for _, bottom, words in lines if words and words[0][2] == name]
|
||||
print(f" {name}: " + " ".join(f"{after - before:.3f}" for before, after in zip(bottoms, bottoms[1:])))
|
||||
@@ -0,0 +1,257 @@
|
||||
/**
|
||||
* Probes of what lay2-fonts left stopping in Office's fonts that Word installs, after Word's PDFs of
|
||||
* word-stops-font-widths, word-stops-font-italic-widths, word-stops-font-heights and word-stops-font-kerning: each line
|
||||
* is "<probe> ..." between a line above and below it, so pdftotext finds it, and each measured word is one word.
|
||||
*
|
||||
* MB1a to MB1l: the bold Word makes itself for a font without a bold face ("a font not in the width tables"): Word's PDF of
|
||||
* word-stops-font-widths showed each character of Calibri Light, Franklin Gothic Book and Impact 18 thousandths of an em
|
||||
* wider in bold, at 10 points, and the spaces as wide. Here at 8, 9, 11, 12, 14, 16, 20, 28, 36, 48, 72 and 10 points
|
||||
* (a to l), in Calibri Light, Franklin Gothic Book and Impact: a word of ten H's, of ten i's, and "H H H H H H H H H H",
|
||||
* each on a line of its own that names the font, with four of each from 28 points and three from 48, bold and not, so
|
||||
* whether the 18 is of an em or of a point shows
|
||||
* MB2a to MB2c: the same text kerned from 1 point with standard and contextual ligatures, as Word's Normal template has
|
||||
* it, in each font's made bold at 11 points: "To Wyatt AVATAR office", for whether Word kerns it and joins its letters
|
||||
* as the regular face
|
||||
* MB3a to MB3c: 20 lines of each font's made bold at 11 points, and 20 at 20 points, for the height of its lines
|
||||
* MB4a, MB4b: Pacifico, which the document embeds, regular only, as demo/text/custom-fonts does: a word of ten H's in
|
||||
* bold and not, at 10 and 20 points, for the bold Word makes of an embedded font
|
||||
* FB1a to FB1h: characters Office's fonts don't have, which Word drew in other fonts in word-stops-font-widths: each a
|
||||
* word of ten, in runs with no language, and in English, Russian, Greek, Vietnamese and Japanese (w:lang), and with an
|
||||
* East Asian font of their own (w:eastAsia MS Mincho): whether the font Word draws them in depends on the run's
|
||||
* language or East Asian font ("a character whose width in its font isn't known")
|
||||
* FB2a to FB2f: 10 lines of 11 points each with one such character in it, and 10 without, for whether the font Word draws
|
||||
* it in makes the line taller
|
||||
* KL1a to KL1x: "ToToToToTo AVAVAVAVAV WaWaWaWaWa" kerned from 1 point in Trebuchet MS, Verdana, Tahoma, Impact, Gill Sans
|
||||
* MT and Franklin Gothic Book, whose kerning is in their kern tables alone, with standard ligatures, historical and
|
||||
* discretional, all, and none written as w14:ligatures (a to d for each font): Word's PDF of word-stops-font-kerning
|
||||
* showed them not kerned with standard and contextual ligatures, and kerned without ligatures ("ligatures of a setting
|
||||
* not yet followed")
|
||||
* KL2: a line of prose in Verdana 10, kerned with standard and contextual ligatures, as word-stops-font-kerning's P has it,
|
||||
* whose lines broke there, as Verdana is wider than the probe made room for
|
||||
* DS1a, DS1b: a picture 30 points tall beside Corbel 11 and beside Consolas 11, whose descents in their hhea tables, 525
|
||||
* and 527 of 2048, aren't their descents for Windows, 550 and 514: the line is as tall as the picture and the descent
|
||||
* DS2a, DS2b: Courier New 11 beside Corbel 11, and beside Consolas 11: the line is the taller ascent and the deeper descent
|
||||
*
|
||||
* Usage: npm run run-ts -- scripts/layout-probes/stops2/word-stops-office-fonts.ts [folder], which writes
|
||||
* word-stops-office-fonts.docx and word-stops-office-fonts.json, the text of each line of MB, FB and KL for the reader,
|
||||
* word-stops-office-fonts.py
|
||||
*/
|
||||
// cspell:ignore Wyatt AVATAR Pacifico AVAVAVAVAV hhea
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { Paragraph, TextRun } from "docx";
|
||||
|
||||
import { type Child, PAGE, group, line, marker, newPage, picture, prose, replaceMarkerRun, write } from "./kit";
|
||||
|
||||
const letters = "abcdefghijklmnopqrstuvwxyz";
|
||||
const MADE_BOLD = ["Calibri Light", "Franklin Gothic Book", "Impact"] as const;
|
||||
const SIZES = [8, 9, 11, 12, 14, 16, 20, 28, 36, 48, 72, 10] as const;
|
||||
// What is measured, each on a line of its own: a word of H's, one of i's, and H's apart, fewer of them at larger sizes, so
|
||||
// each fits on its line beside its label
|
||||
const copiesAt = (size: number): number => (size >= 48 ? 3 : size >= 28 ? 4 : 10);
|
||||
const MEASURES = {
|
||||
H: (copies: number): string => "H".repeat(copies),
|
||||
i: (copies: number): string => "i".repeat(copies),
|
||||
space: (copies: number): string => Array.from({ length: copies }, () => "H").join(" "),
|
||||
} as const;
|
||||
|
||||
// The measured lines of MB1, MB4 and KL, as the reader reads them: the probe, the font, its size, and how it is written.
|
||||
// Each line of MB1 and MB4 names its font, with underscores for its spaces, as each font's MB1 has the same names
|
||||
const measured: (readonly [probe: string, font: string, size: number, how: string])[] = [];
|
||||
const measuredLines = (probe: string, font: string, size: number, how: string, run: object = {}): Paragraph[] => {
|
||||
measured.push([probe, font, size, how]);
|
||||
return Object.entries(MEASURES).map(
|
||||
([kind, text]) =>
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun(`${probe} ${font.replace(/ /g, "_")} ${how} ${kind} `),
|
||||
new TextRun({ text: text(copiesAt(size)), font, size: size * 2, ...run }),
|
||||
new TextRun(" end"),
|
||||
],
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
const madeBold: Child[] = MADE_BOLD.flatMap((font) =>
|
||||
SIZES.flatMap((size, index) => {
|
||||
const name = `MB1${letters[index]}`;
|
||||
return group(`${name} ${font.replace(/ /g, "_")}`, [
|
||||
...measuredLines(name, font, size, "bold", { bold: true }),
|
||||
...measuredLines(name, font, size, "regular"),
|
||||
]);
|
||||
}),
|
||||
);
|
||||
|
||||
// The kerned text, with Normal's settings, injected, as docx writes no w14:ligatures
|
||||
const KERNED = "To Wyatt AVATAR office";
|
||||
const ligatureRun = (setting: string, text: string, font: string, size: number, bold = false): string =>
|
||||
`<w:r><w:rPr><w:rFonts w:ascii="${font}" w:hAnsi="${font}"/>${bold ? "<w:b/>" : ""}<w:kern w:val="2"/><w:sz w:val="${size * 2}"/><w14:ligatures w14:val="${setting}"/></w:rPr><w:t xml:space="preserve">${text}</w:t></w:r>`;
|
||||
const injected = new Map<string, string>();
|
||||
const runOf = (name: string, xml: string): TextRun => {
|
||||
injected.set(name, xml);
|
||||
return marker(name);
|
||||
};
|
||||
|
||||
const madeBoldKerned: Child[] = MADE_BOLD.flatMap((font, index) => {
|
||||
const name = `MB2${letters[index]}`;
|
||||
return group(name, [
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun(`${name} bold `),
|
||||
runOf(`${name}_bold`, ligatureRun("standardContextual", KERNED, font, 11, true)),
|
||||
new TextRun(" end"),
|
||||
],
|
||||
}),
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun(`${name} regular `),
|
||||
runOf(`${name}_regular`, ligatureRun("standardContextual", KERNED, font, 11)),
|
||||
new TextRun(" end"),
|
||||
],
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
const madeBoldHeights: Child[] = MADE_BOLD.flatMap((font, index) => {
|
||||
const name = `MB3${letters[index]}`;
|
||||
return [
|
||||
line(`${name} above`, { pageBreakBefore: true }),
|
||||
...Array.from({ length: 20 }, (_, row) => line(`${name} ${font} bold 11 line ${row + 1}`, {}, { font, size: 22, bold: true })),
|
||||
...Array.from({ length: 20 }, (_, row) => line(`${name} ${font} bold 20 line ${row + 1}`, {}, { font, size: 40, bold: true })),
|
||||
line(`${name} below`),
|
||||
];
|
||||
});
|
||||
|
||||
const embedded: Child[] = [10, 20].flatMap((size, index) => {
|
||||
const name = `MB4${letters[index]}`;
|
||||
return group(name, [
|
||||
...measuredLines(name, "Pacifico", size, "bold", { bold: true }),
|
||||
...measuredLines(name, "Pacifico", size, "regular"),
|
||||
]);
|
||||
});
|
||||
|
||||
// FB: a character Word drew in another font, the font it is in, and the font Word drew it in for word-stops-font-widths
|
||||
const FALLBACKS = [
|
||||
["Д", "Gill Sans MT", "Calibri"],
|
||||
["Ω", "Century Gothic", "Calibri"],
|
||||
["ƀ", "Trebuchet MS", "Calibri"],
|
||||
["Ж", "Book Antiqua", "Cambria"],
|
||||
["∀", "Trebuchet MS", "Cambria Math"],
|
||||
["≤", "Georgia", "Cambria Math"],
|
||||
["Ⅳ", "Calibri Light", "MS Gothic"],
|
||||
["‥", "Consolas", "MS Mincho"],
|
||||
] as const;
|
||||
const LANGUAGES = [
|
||||
["none", ""],
|
||||
["English", '<w:lang w:val="en-US"/>'],
|
||||
["Russian", '<w:lang w:val="ru-RU"/>'],
|
||||
["Greek", '<w:lang w:val="el-GR"/>'],
|
||||
["Vietnamese", '<w:lang w:val="vi-VN"/>'],
|
||||
["Japanese", '<w:lang w:eastAsia="ja-JP"/>'],
|
||||
["MS_Mincho", ""],
|
||||
] as const;
|
||||
const fallbackRun = (character: string, font: string, language: string, eastAsia: boolean): string =>
|
||||
`<w:r><w:rPr><w:rFonts w:ascii="${font}" w:hAnsi="${font}" w:cs="${font}" w:eastAsia="${eastAsia ? "MS Mincho" : font}"/><w:sz w:val="20"/>${language}</w:rPr><w:t xml:space="preserve">${character.repeat(10)}</w:t></w:r>`;
|
||||
const fallbacks: Child[] = FALLBACKS.flatMap(([character, font], index) => {
|
||||
const name = `FB1${letters[index]}`;
|
||||
return group(
|
||||
name,
|
||||
LANGUAGES.map(
|
||||
([language, xml]) =>
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun(`${name} ${language} `),
|
||||
runOf(`${name}_${language}`, fallbackRun(character, font, xml, language === "MS_Mincho")),
|
||||
new TextRun(" end"),
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
const fallbackHeights: Child[] = FALLBACKS.slice(0, 6).flatMap(([character, font], index) => {
|
||||
const name = `FB2${letters[index]}`;
|
||||
return [
|
||||
line(`${name} above`, { pageBreakBefore: true }),
|
||||
...Array.from({ length: 10 }, (_, row) => line(`${name} ${font} line ${row + 1} with ${character}`, {}, { font, size: 22 })),
|
||||
...Array.from({ length: 10 }, (_, row) => line(`${name} ${font} line ${row + 1} without`, {}, { font, size: 22 })),
|
||||
line(`${name} below`),
|
||||
];
|
||||
});
|
||||
|
||||
const KERN_TABLE_FONTS = ["Trebuchet MS", "Verdana", "Tahoma", "Impact", "Gill Sans MT", "Franklin Gothic Book"] as const;
|
||||
const SETTINGS = ["standard", "historicalDiscretional", "all", "none"] as const;
|
||||
const PAIRS = "ToToToToTo AVAVAVAVAV WaWaWaWaWa";
|
||||
const kernTable: Child[] = KERN_TABLE_FONTS.flatMap((font, fontIndex) =>
|
||||
SETTINGS.flatMap((setting, index) => {
|
||||
const name = `KL1${letters[fontIndex * 4 + index]}`;
|
||||
measured.push([name, font, 10, setting]);
|
||||
return group(name, [
|
||||
new Paragraph({
|
||||
children: [new TextRun(`${name} ${setting} `), runOf(name, ligatureRun(setting, PAIRS, font, 10)), new TextRun(" end")],
|
||||
}),
|
||||
]);
|
||||
}),
|
||||
);
|
||||
const PROSE = "“To Wyatt’s office,” Avery wrote — fifty-five affluent officials";
|
||||
const verdana: Child[] = group("KL2", [
|
||||
new Paragraph({
|
||||
children: [new TextRun("KL2 "), runOf("KL2", ligatureRun("standardContextual", PROSE, "Verdana", 10)), new TextRun(" end")],
|
||||
}),
|
||||
]);
|
||||
|
||||
const descents: Child[] = (["Corbel", "Consolas"] as const).flatMap((font, index) => [
|
||||
...group(`DS1${letters[index]}`, [
|
||||
new Paragraph({ children: [new TextRun({ text: `DS1${letters[index]} ${font} `, font, size: 22 }), picture(30)] }),
|
||||
new Paragraph({ children: [new TextRun({ text: `DS1${letters[index]} ${font} `, font, size: 22 }), picture(30)] }),
|
||||
]),
|
||||
...group(`DS2${letters[index]}`, [
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({ text: `DS2${letters[index]} ${font} `, font, size: 22 }),
|
||||
new TextRun({ text: "Courier New", font: "Courier New", size: 22 }),
|
||||
],
|
||||
}),
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({ text: `DS2${letters[index]} ${font} `, font, size: 22 }),
|
||||
new TextRun({ text: "Courier New", font: "Courier New", size: 22 }),
|
||||
],
|
||||
}),
|
||||
line(`DS2${letters[index]} ${prose(3)}`),
|
||||
]),
|
||||
]);
|
||||
|
||||
const PACIFICO = readFileSync("demo/assets/Pacifico.ttf");
|
||||
// The kit writes into the folder given, or build/word-stops
|
||||
const folder = process.argv[2] ?? "build/word-stops";
|
||||
await write({
|
||||
name: "word-stops-office-fonts",
|
||||
sections: [
|
||||
{
|
||||
properties: PAGE,
|
||||
children: [
|
||||
...madeBold,
|
||||
newPage(),
|
||||
...madeBoldKerned,
|
||||
...embedded,
|
||||
...madeBoldHeights,
|
||||
newPage(),
|
||||
...fallbacks,
|
||||
...fallbackHeights,
|
||||
newPage(),
|
||||
...kernTable,
|
||||
...verdana,
|
||||
newPage(),
|
||||
...descents,
|
||||
],
|
||||
},
|
||||
],
|
||||
options: { fonts: [{ name: "Pacifico", data: PACIFICO }] },
|
||||
injections: [...injected].map(([name, xml]) => replaceMarkerRun(name, xml)),
|
||||
});
|
||||
writeFileSync(
|
||||
join(folder, "word-stops-office-fonts.json"),
|
||||
`${JSON.stringify({ measured, copies: Object.fromEntries(SIZES.map((size) => [size, copiesAt(size)])), kerned: KERNED, pairs: PAIRS, prose: PROSE })}\n`,
|
||||
);
|
||||
@@ -20,7 +20,13 @@ import re
|
||||
import sys
|
||||
|
||||
base = sys.argv[1]
|
||||
probe = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.basename(base) + ".json"), encoding="utf8"))
|
||||
# The probe's .json is beside this reader, or in stops2 beside it for the documents of lay-stops2's batch, such as
|
||||
# word-stops-font-kerning
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
SIDECAR = os.path.join(HERE, os.path.basename(base) + ".json")
|
||||
if not os.path.exists(SIDECAR):
|
||||
SIDECAR = os.path.join(HERE, "stops2", os.path.basename(base) + ".json")
|
||||
probe = json.load(open(SIDECAR, encoding="utf8"))
|
||||
SIZE = probe["size"]
|
||||
COPIES = probe["copies"]
|
||||
FACES = probe["faces"]
|
||||
|
||||
@@ -28,7 +28,13 @@ import unicodedata
|
||||
sys.setrecursionlimit(20000)
|
||||
|
||||
base = sys.argv[1]
|
||||
probe = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.basename(base) + ".json"), encoding="utf8"))
|
||||
# The probe's .json is beside this reader, or in stops2 beside it for the documents of lay-stops2's batch, such as
|
||||
# word-stops-font-kerning
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
SIDECAR = os.path.join(HERE, os.path.basename(base) + ".json")
|
||||
if not os.path.exists(SIDECAR):
|
||||
SIDECAR = os.path.join(HERE, "stops2", os.path.basename(base) + ".json")
|
||||
probe = json.load(open(SIDECAR, encoding="utf8"))
|
||||
SIZE = probe["size"]
|
||||
SPACES = {" ", " "}
|
||||
# The outline of a space, which has none
|
||||
@@ -46,7 +52,8 @@ def read_glyph_lines():
|
||||
outlines = {}
|
||||
for glyph, body in re.findall(r'<g id="glyph-(\d+-\d+)">(.*?)</g>', svg, re.S):
|
||||
path = re.search(r' d="([^"]*)"', body)
|
||||
outlines[glyph] = path.group(1) if path else EMPTY
|
||||
# A path of moves alone, such as "M 0 0 Z M 0 0", draws nothing, as Calibri Light italic's space doesn't
|
||||
outlines[glyph] = path.group(1) if path and re.search(r"[LCQ]", path.group(1)) else EMPTY
|
||||
lines = []
|
||||
run = 0
|
||||
for page in svg.split("<page>")[1:]:
|
||||
@@ -60,6 +67,9 @@ def read_glyph_lines():
|
||||
|
||||
|
||||
glyph_lines = read_glyph_lines()
|
||||
# The run of the first glyph of a line a probe's line broke onto, which has no place, as it can't be measured from the
|
||||
# glyph before it, at the end of the line before
|
||||
BROKEN = -1
|
||||
LINES = probe["lines"]
|
||||
if len(glyph_lines) < len(LINES):
|
||||
sys.exit(f"The PDF has {len(glyph_lines)} lines of glyphs, fewer than the probe's {len(LINES)}")
|
||||
@@ -209,6 +219,15 @@ for index, (name, face, kerned, ligatures, text) in enumerate(LINES):
|
||||
advances = advance_of.setdefault(face, {})
|
||||
drawn = [(at, glyph, x) for at, (glyph, x, _) in enumerate(glyphs) if glyph != EMPTY]
|
||||
letters = [character for character in text if character not in SPACES]
|
||||
# A line that broke in two or more, in a font wider than the probe made room for, goes on on the next lines of
|
||||
# glyphs, whose characters' widths are read on their own
|
||||
while len(drawn) < len(letters) and cursor < len(glyph_lines) - 1:
|
||||
following = [(len(glyphs) + at, glyph, x) for at, (glyph, x, _) in enumerate(glyph_lines[cursor]) if glyph != EMPTY]
|
||||
if len(drawn) + len(following) > len(letters):
|
||||
break
|
||||
glyphs = glyphs + glyph_lines[cursor]
|
||||
drawn = drawn + following
|
||||
cursor += 1
|
||||
if len(drawn) != len(letters):
|
||||
problems.append(f"line {index + 1} ({name}): {len(drawn)} glyphs for {len(letters)} characters")
|
||||
continue
|
||||
@@ -220,17 +239,32 @@ for index, (name, face, kerned, ligatures, text) in enumerate(LINES):
|
||||
continue
|
||||
units = units_of(face, text, glyphs, kind)
|
||||
if units is None and cursor < len(glyph_lines):
|
||||
# A line that broke in two is drawn on two lines, whose glyphs' places can't be measured across the break, so it
|
||||
# is left out, and its second half passed over, so the lines after it are read as theirs. A line after a line of
|
||||
# glyphs that isn't one of the probe's is read from the next
|
||||
if units_of(face, text, glyphs + glyph_lines[cursor], kind) is not None:
|
||||
problems.append(f"line {index + 1} ({name}, {face}): broke in two, so left out")
|
||||
cursor += 1
|
||||
continue
|
||||
units = units_of(face, text, glyph_lines[cursor], kind)
|
||||
if units is not None:
|
||||
problems.append(f"line {index + 1} ({name}, {face}): after a line of glyphs not of the probe")
|
||||
cursor += 1
|
||||
# A line that broke in two or more, in a font wider than the probe made room for, is drawn on as many lines,
|
||||
# whose glyphs' places can't be measured across a break: so the first glyph of each line after the first has no
|
||||
# place, which leaves out the pairs either side of it. The lines of prose (P), whose words' places are measured
|
||||
# from the start of the line, are left out. A line after a line of glyphs that isn't one of the probe's is read
|
||||
# from the next
|
||||
broken = glyphs
|
||||
for extra in range(1, 6):
|
||||
if cursor + extra - 1 >= len(glyph_lines) - 1:
|
||||
break
|
||||
following = glyph_lines[cursor + extra - 1]
|
||||
broken = broken + [(glyph, None, BROKEN) if at == 0 else (glyph, x, run) for at, (glyph, x, run) in enumerate(following)]
|
||||
units = units_of(face, text, broken, kind)
|
||||
if units is not None:
|
||||
problems.append(f"line {index + 1} ({name}, {face}): broke into {extra + 1} lines")
|
||||
cursor += extra
|
||||
if kind == "P":
|
||||
units = None
|
||||
glyphs = None
|
||||
break
|
||||
if units is None and glyphs is not None:
|
||||
units = units_of(face, text, glyph_lines[cursor], kind)
|
||||
if units is not None:
|
||||
problems.append(f"line {index + 1} ({name}, {face}): after a line of glyphs not of the probe")
|
||||
cursor += 1
|
||||
if units is None and glyphs is None:
|
||||
continue
|
||||
if units is None:
|
||||
problems.append(f"line {index + 1} ({name}, {face}): its {len(glyphs)} glyphs can't be read as its {len(text)} characters")
|
||||
continue
|
||||
@@ -252,18 +286,19 @@ for index, (name, face, kerned, ligatures, text) in enumerate(LINES):
|
||||
words = joined.setdefault(f"{face}|{ligatures}", {})
|
||||
word = []
|
||||
# Words are parted by spaces, U+0020; a no-break space is in its word. The last ends with the line
|
||||
for unit, x, end in [*units, (" ", None, "end")]:
|
||||
for unit, x, run in [*units, (" ", None, "end")]:
|
||||
if unit != " ":
|
||||
word.append((unit, x))
|
||||
word.append((unit, x, run))
|
||||
continue
|
||||
# A space ends a word, drawn or not: where it is drawn, A's word is as wide as from its start to the space
|
||||
if word and all(at is not None for _, at in word):
|
||||
key = "".join(letters_of(unit) for unit, _ in word)
|
||||
# A space ends a word, drawn or not: where it is drawn, A's word is as wide as from its start to the space. A
|
||||
# word whose first glyph starts a line a probe's line broke onto, so has no place, is read as the others are
|
||||
if word and all(at is not None or within == BROKEN for _, at, within in word):
|
||||
key = "".join(letters_of(unit) for unit, _, _ in word)
|
||||
read_words.setdefault(f"{face}|{ligatures}", set()).add(key)
|
||||
if any(unit.startswith("⟨") for unit, _ in word):
|
||||
words[key] = [unit for unit, _ in word]
|
||||
if kind == "A" and x is not None:
|
||||
aptos.append([face, ligatures, key, [unit for unit, _ in word], round(x - word[0][1], 4)])
|
||||
if any(unit.startswith("⟨") for unit, _, _ in word):
|
||||
words[key] = [unit for unit, _, _ in word]
|
||||
if kind == "A" and x is not None and word[0][1] is not None:
|
||||
aptos.append([face, ligatures, key, [unit for unit, _, _ in word], round(x - word[0][1], 4)])
|
||||
word = []
|
||||
elif kind == "P":
|
||||
# Where each word starts, from the start of the line, in points
|
||||
@@ -315,7 +350,7 @@ for face, units in kerned_lines:
|
||||
offs = [
|
||||
units[step + 1][1] - units[step][1] - advances.get(units[step][0], 0) * SIZE / 1000
|
||||
for step in range(at, end)
|
||||
if units[step][0] in advances
|
||||
if units[step][0] in advances and units[step][1] is not None
|
||||
]
|
||||
# The pairs that aren't kerned, which are off by the run's drift alone
|
||||
plain = sorted(off for off in offs if abs(off) < 0.03)
|
||||
@@ -391,7 +426,7 @@ if "--json" in sys.argv:
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
sys.exit()
|
||||
|
||||
for problem in problems[:20]:
|
||||
for problem in problems[: int(os.environ.get("PROBLEMS", "20"))]:
|
||||
print("!", problem)
|
||||
print(f"== K: kerning of each pair of the {len(probe['characters'])} characters, in thousandths of an em, of the pairs read")
|
||||
for face, table in kerning.items():
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* Office's fonts that Word for Mac installs, other than those docx/layout's width tables have from fonts with an open
|
||||
* license made as wide as them, and the file of each face Word draws them in, for scripts/generate-font-widths.ts and
|
||||
* scripts/generate-font-kerning.ts, which read Word's own files of them. They are in Word's folder of fonts
|
||||
* (/Applications/Microsoft Word.app/Contents/Resources/DFonts), but for Georgia, Impact and Trebuchet MS, which Word takes
|
||||
* from the Mac's (/System/Library/Fonts/Supplemental). Word draws Verdana and Tahoma in its own files, which have letters
|
||||
* the Mac's don't, such as Tahoma's Ѹ, which Word's PDF shows as wide as its own file has it.
|
||||
*/
|
||||
// cspell:ignore Aptos calibril calibrili Consola Consolab Consolai Consolaz Candarab Candarai Candaraz Corbelb Corbeli Corbelz
|
||||
// cspell:ignore Constan Constanb Constani Constanz tahomabd
|
||||
|
||||
/** The faces of a font, each in a file of its own */
|
||||
export type OfficeFace = "regular" | "bold" | "italic" | "boldItalic";
|
||||
|
||||
/**
|
||||
* Office's other fonts that Word for Mac installs, and the file of each face Word draws them in. A face without a file is
|
||||
* one Word makes itself. Word draws Trebuchet MS bold italic as its bold, slanted, though the Mac has a Trebuchet MS Bold
|
||||
* Italic, as Word's PDF shows: its widths and kerning are the bold's (word-stops-font-widths, word-stops-font-kerning K18)
|
||||
*/
|
||||
export const OFFICE_FONTS: readonly {
|
||||
readonly name: string;
|
||||
readonly files: Readonly<Partial<Record<OfficeFace, string>>>;
|
||||
}[] = [
|
||||
{ name: "Calibri Light", files: { regular: "calibril.ttf", italic: "calibrili.ttf" } },
|
||||
{
|
||||
name: "Aptos",
|
||||
files: { regular: "Aptos.ttf", bold: "Aptos-Bold.ttf", italic: "Aptos-Italic.ttf", boldItalic: "Aptos-Bold-Italic.ttf" },
|
||||
},
|
||||
{
|
||||
name: "Aptos Narrow",
|
||||
files: {
|
||||
regular: "Aptos-Narrow.ttf",
|
||||
bold: "Aptos-Narrow-Bold.ttf",
|
||||
italic: "Aptos-Narrow-Italic.ttf",
|
||||
boldItalic: "Aptos-Narrow-Bold-Italic.ttf",
|
||||
},
|
||||
},
|
||||
{ name: "Trebuchet MS", files: { regular: "Trebuchet MS.ttf", bold: "Trebuchet MS Bold.ttf", italic: "Trebuchet MS Italic.ttf" } },
|
||||
{
|
||||
name: "Georgia",
|
||||
files: { regular: "Georgia.ttf", bold: "Georgia Bold.ttf", italic: "Georgia Italic.ttf", boldItalic: "Georgia Bold Italic.ttf" },
|
||||
},
|
||||
{
|
||||
name: "Verdana",
|
||||
files: { regular: "Verdana.ttf", bold: "Verdana Bold.ttf", italic: "Verdana Italic.ttf", boldItalic: "Verdana Bold Italic.ttf" },
|
||||
},
|
||||
{ name: "Tahoma", files: { regular: "tahoma.ttf", bold: "tahomabd.ttf" } },
|
||||
{
|
||||
name: "Century Gothic",
|
||||
files: {
|
||||
regular: "Century Gothic.ttf",
|
||||
bold: "Century Gothic Bold.ttf",
|
||||
italic: "Century Gothic Italic.ttf",
|
||||
boldItalic: "Century Gothic Bold Italic.ttf",
|
||||
},
|
||||
},
|
||||
{ name: "Consolas", files: { regular: "Consola.ttf", bold: "Consolab.ttf", italic: "Consolai.ttf", boldItalic: "Consolaz.ttf" } },
|
||||
{ name: "Candara", files: { regular: "Candara.ttf", bold: "Candarab.ttf", italic: "Candarai.ttf", boldItalic: "Candaraz.ttf" } },
|
||||
{ name: "Corbel", files: { regular: "Corbel.ttf", bold: "Corbelb.ttf", italic: "Corbeli.ttf", boldItalic: "Corbelz.ttf" } },
|
||||
{ name: "Constantia", files: { regular: "Constan.ttf", bold: "Constanb.ttf", italic: "Constani.ttf", boldItalic: "Constanz.ttf" } },
|
||||
{
|
||||
name: "Book Antiqua",
|
||||
files: {
|
||||
regular: "Book Antiqua.ttf",
|
||||
bold: "Book Antiqua Bold.ttf",
|
||||
italic: "Book Antiqua Italic.ttf",
|
||||
boldItalic: "Book Antiqua Bold Italic.ttf",
|
||||
},
|
||||
},
|
||||
{ name: "Franklin Gothic Book", files: { regular: "Franklin Gothic Book.ttf", italic: "Franklin Gothic Book Italic.ttf" } },
|
||||
{
|
||||
name: "Gill Sans MT",
|
||||
files: {
|
||||
regular: "Gill Sans MT.ttf",
|
||||
bold: "Gill Sans MT Bold.ttf",
|
||||
italic: "Gill Sans MT Italic.ttf",
|
||||
boldItalic: "Gill Sans MT Bold Italic.ttf",
|
||||
},
|
||||
},
|
||||
{ name: "Impact", files: { regular: "Impact.ttf" } },
|
||||
];
|
||||
export type OfficeFont = (typeof OFFICE_FONTS)[number];
|
||||
@@ -924,7 +924,7 @@ describe("estimatePageNumbersWith", () => {
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(pageNumbersOf(inFont("Aptos"), estimatePageNumbersWith({ measureWidth }))).to.deep.equal({ first: "1" });
|
||||
expect(pageNumbersOf(inFont("Roboto"), estimatePageNumbersWith({ measureWidth }))).to.deep.equal({ first: "1" });
|
||||
expect(pageNumbersOf(inFont("Arial"), estimatePageNumbersWith({ measureWidth }))).to.deep.equal({ first: "1", last: "1" });
|
||||
});
|
||||
|
||||
@@ -1079,10 +1079,10 @@ describe("estimatePageNumbersWith", () => {
|
||||
});
|
||||
|
||||
it("should measure text in a font not in the width tables as the most similar font that is (word-watertight-text.docx TX18)", () => {
|
||||
// Word drew the pangram 3781.2 twips wide in Aptos, 3905.6 in Georgia and 4384.2 in Verdana, and in Cambria,
|
||||
// 3820.8, in a font it doesn't have. The guess measures them as Arial, Times New Roman and Arial, 2% wider, 8%
|
||||
// narrower and 12% narrower than Word drew them, and each is a line, as it was in Word
|
||||
const pangrams = ["Aptos", "Georgia", "Verdana", "Watertight Missing Sans"].map(
|
||||
// Word drew the pangram 3616.5 twips wide in Segoe UI and 3457.5 in Garamond, and in Cambria, 3820.8, in a font
|
||||
// it doesn't have. The guess measures them as Calibri, Times New Roman and Arial, 1% narrower, 4% wider and 1%
|
||||
// wider than Word drew them, and each is a line, as it was in Word
|
||||
const pangrams = ["Segoe UI", "Garamond", "Watertight Missing Sans"].map(
|
||||
(font) => new Paragraph({ children: [new TextRun({ text: "Thequickbrownfoxjumpsoverthelazydog", font, size: 22 })] }),
|
||||
);
|
||||
const document = new Document({ sections: [{ children: pangrams }] });
|
||||
@@ -1094,8 +1094,8 @@ describe("estimatePageNumbersWith", () => {
|
||||
const widths = pages[0].body.map((block) =>
|
||||
block.type === "paragraph" ? block.lines.map(({ textWidth }) => Math.round(textWidth * 15)) : [],
|
||||
);
|
||||
expect(widths).to.deep.equal([[3864], [3580], [3864], [3864]]);
|
||||
expect(pageNumbersOf(around(new TextRun({ text: "Text", font: "Aptos" })), GUESS)).to.deep.equal({ first: "1", last: "1" });
|
||||
expect(widths).to.deep.equal([[3589], [3580], [3864]]);
|
||||
expect(pageNumbersOf(around(new TextRun({ text: "Text", font: "Roboto" })), GUESS)).to.deep.equal({ first: "1", last: "1" });
|
||||
});
|
||||
|
||||
it("should measure a date as it is written, where Word writes the date it opens the document on (word-watertight-pages.docx PG7a)", () => {
|
||||
|
||||
@@ -57,7 +57,7 @@ describe("layOutPasses", () => {
|
||||
new Paragraph({
|
||||
spacing: line,
|
||||
children: [
|
||||
new Bookmark({ id: "start", children: [new TextRun({ text: "On page", font: "Aptos" })] }),
|
||||
new Bookmark({ id: "start", children: [new TextRun({ text: "On page", font: "Roboto" })] }),
|
||||
new PageReference("target"),
|
||||
],
|
||||
}),
|
||||
|
||||
@@ -108,7 +108,7 @@ describe("measurerOf", () => {
|
||||
const measurer = measurerOf(() => 0);
|
||||
expect(measurer.unknownFont!({ font: "Calibri" }, "a")).to.equal(false);
|
||||
expect(measurer.unknownFont!({ font: "Carlito" })).to.equal(false);
|
||||
expect(measurer.unknownFont!({ font: "Aptos" }, "a")).to.equal(true);
|
||||
expect(measurer.unknownFont!({ font: "Roboto" }, "a")).to.equal(true);
|
||||
// An East Asian font's lines are as tall as the table says, and the function measures its Latin letters
|
||||
expect(measurer.unknownFont!({ font: "Yu Gothic" }, "a")).to.equal(false);
|
||||
});
|
||||
|
||||
@@ -899,8 +899,8 @@ describe("paginate", () => {
|
||||
|
||||
it("should stop at a font not in the width tables, measuring with them, unless asked to measure it as the most similar", () => {
|
||||
const inFont = (font: string): DocumentContent => document([withText("a", "x", { font, size: 11 }), paragraph("b", 1)]);
|
||||
expect(paginate(inFont("Aptos")).stoppedAt).to.equal(STOP);
|
||||
expect(paginate(inFont("Aptos"), { measurer: SIMILAR_FONT_MEASURER }).stoppedAt).to.equal(undefined);
|
||||
expect(paginate(inFont("Roboto")).stoppedAt).to.equal(STOP);
|
||||
expect(paginate(inFont("Roboto"), { measurer: SIMILAR_FONT_MEASURER }).stoppedAt).to.equal(undefined);
|
||||
// Carlito is made as wide as Calibri, so is measured as it
|
||||
expect(paginate(inFont("Carlito")).stoppedAt).to.equal(undefined);
|
||||
});
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
} from "docx";
|
||||
import { buildTestFont } from "tests/font-file";
|
||||
|
||||
import { layOutPasses } from "./layout-passes";
|
||||
import { type DocumentContent, type ParagraphBlock, readDocument } from "./read-document";
|
||||
import { readDocx } from "./read-docx";
|
||||
|
||||
@@ -232,6 +233,59 @@ describe("readDocx", () => {
|
||||
expect(item.type === "text" && item.font).to.deep.equal({ font: "Calibri", kerning: 1, ligatures: "standardContextual" });
|
||||
});
|
||||
|
||||
it("should lay out the headings of Word 2013 to 2019's Normal template in Calibri Light, kerned and with its ligatures", () => {
|
||||
// The theme's heading font, Calibri Light, kerned from 1 point with standard and contextual ligatures, as Word's own
|
||||
// templates have it, which the layout stopped at until the width tables had it
|
||||
// (scripts/layout-probes/stops2/word-stops-font-kerning.ts)
|
||||
const W14 = 'xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"';
|
||||
const A = 'xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"';
|
||||
const content = readDocx(
|
||||
new Map([
|
||||
[
|
||||
"_rels/.rels",
|
||||
relationships(`<Relationship Id="rId1" Type="${TRANSITIONAL}/officeDocument" Target="word/document.xml"/>`),
|
||||
],
|
||||
[
|
||||
"word/_rels/document.xml.rels",
|
||||
relationships(
|
||||
`<Relationship Id="rId1" Type="${TRANSITIONAL}/styles" Target="styles.xml"/>`,
|
||||
`<Relationship Id="rId2" Type="${TRANSITIONAL}/settings" Target="settings.xml"/>`,
|
||||
`<Relationship Id="rId3" Type="${TRANSITIONAL}/theme" Target="theme/theme1.xml"/>`,
|
||||
),
|
||||
],
|
||||
[
|
||||
"word/theme/theme1.xml",
|
||||
parse(
|
||||
`<a:theme ${A}><a:themeElements><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/></a:minorFont></a:fontScheme></a:themeElements></a:theme>`,
|
||||
),
|
||||
],
|
||||
[
|
||||
"word/styles.xml",
|
||||
parse(
|
||||
`<w:styles ${W} ${W14}><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:asciiTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi"/><w:kern w:val="2"/><w:sz w:val="22"/><w14:ligatures w14:val="standardContextual"/></w:rPr></w:rPrDefault></w:docDefaults><w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><w:rPr><w:rFonts w:asciiTheme="majorHAnsi" w:hAnsiTheme="majorHAnsi"/><w:sz w:val="32"/></w:rPr></w:style></w:styles>`,
|
||||
),
|
||||
],
|
||||
["word/settings.xml", parse(COMPATIBLE)],
|
||||
[
|
||||
"word/document.xml",
|
||||
documentOf(
|
||||
`<w:p><w:pPr><w:pStyle w:val="Heading1"/></w:pPr><w:r><w:t>To Wyatt’s affluent office</w:t></w:r></w:p><w:p><w:r><w:t>Text</w:t></w:r></w:p>`,
|
||||
),
|
||||
],
|
||||
]),
|
||||
);
|
||||
const [item] = (content.blocks[0].block as ParagraphBlock).items;
|
||||
expect(item.type === "text" && item.font).to.deep.include({
|
||||
font: "Calibri Light",
|
||||
size: 16,
|
||||
kerning: 1,
|
||||
ligatures: "standardContextual",
|
||||
});
|
||||
const { stoppedAt, pageCount } = layOutPasses(content);
|
||||
expect(stoppedAt).to.equal(undefined);
|
||||
expect(pageCount).to.equal(1);
|
||||
});
|
||||
|
||||
it("should read a .docx without settings as one in compatibility mode, as Word lays it out", () => {
|
||||
const content = readDocx(new Map([["word/document.xml", documentOf("<w:p/>")]]));
|
||||
expect(content.unsupported).to.equal("a document in compatibility mode");
|
||||
|
||||
@@ -415,13 +415,13 @@ describe("createFontFileMeasurer", () => {
|
||||
expect(measurer.unknownFont!({ font: "Probe Sans", italic: true })).to.equal(false);
|
||||
expect(measurer.unknownFont!({ font: "Probe Sans", bold: true }, "AB")).to.equal(true);
|
||||
expect(measurer.unknownFont!({ font: "Calibri" }, "AB")).to.equal(false);
|
||||
expect(measurer.unknownFont!({ font: "Aptos" })).to.equal(true);
|
||||
expect(measurer.unknownFont!({ font: "Roboto" })).to.equal(true);
|
||||
const withoutUnknown = createFontFileMeasurer(fonts({ advances: LETTERS }), {
|
||||
measureWidth: () => 0,
|
||||
measureLineHeight: () => 0,
|
||||
measureDescent: () => 0,
|
||||
});
|
||||
expect(withoutUnknown.unknownFont!({ font: "Aptos" })).to.equal(false);
|
||||
expect(withoutUnknown.unknownFont!({ font: "Roboto" })).to.equal(false);
|
||||
});
|
||||
|
||||
it("should move a tab typed in the text to the next half inch from the start of the text", () => {
|
||||
|
||||
+1436
-4
File diff suppressed because one or more lines are too long
@@ -1,10 +1,12 @@
|
||||
/**
|
||||
* How wide each character is in the fonts Word documents use most, and how tall a line of text is.
|
||||
* How wide each character is in the fonts Word documents use most, and in Office's other fonts that Word installs, and how
|
||||
* tall a line of text is.
|
||||
*
|
||||
* Generated by scripts/generate-font-widths.ts from fonts with an open license that have the same widths:
|
||||
* Carlito (Calibri), Caladea (Cambria), and Liberation Sans, Serif and Mono (Arial, Times New Roman and Courier New),
|
||||
* plain, bold, italic and bold italic, checked against Word's: Word's own widths where its PDFs show they differ, and none
|
||||
* where Word draws a character in another font, as its width isn't known. Do not edit by hand.
|
||||
* where Word draws a character in another font, as its width isn't known; and from Word's own files of Office's other
|
||||
* fonts, checked against Word's PDFs of every character of them, and of how tall their lines are. Do not edit by hand.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
@@ -30,12 +32,18 @@ export type FontWidths = {
|
||||
* known; and "*" with two digits repeats what is before it that many more times
|
||||
*/
|
||||
readonly regular: string;
|
||||
/** The same for bold text */
|
||||
readonly bold: string;
|
||||
/** The same for italic text */
|
||||
readonly italic: string;
|
||||
/** The same for bold italic text */
|
||||
readonly boldItalic: string;
|
||||
/**
|
||||
* The same for bold text, or none for a font without a bold face, such as Calibri Light, whose bold Word makes itself,
|
||||
* each character wider than the regular, which the tables don't follow yet
|
||||
*/
|
||||
readonly bold?: string;
|
||||
/**
|
||||
* The same for italic text, or none for a font without an italic face, such as Tahoma, whose italic Word slants from
|
||||
* the upright face, as wide as it
|
||||
*/
|
||||
readonly italic?: string;
|
||||
/** The same for bold italic text, or none for a font without a bold italic face, as for italic text */
|
||||
readonly boldItalic?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -108,5 +116,166 @@ export const FONT_WIDTHS: readonly FontWidths[] = [
|
||||
boldItalic:
|
||||
"9o*7R!9o*09!*0d9o*2k!*069o*0j!*03=9o!*039o!*02=!*049o*06!9o!9o*0j!9o*0H!9o*2O00*069o*14!=9o*0E!*05=9o*2q!*03=9o*1o!*057QfE88fY5k3/2G8G3d2D0U00*04!9o*04!9o*0b!*029o!*0200*04389o!9o*02!*039o9o!9o!9o!*049o!*0o9o3u00*04!00*09!*0e9o!*0f9o*04!*0a9o*0l!*0p00*0w!*0j9o!*0c9o!!9o!*0a9o!*02=!*069o!*0z9o9o!*059o*03!*0M9o*05!*0h9o!*1o9o!*029o!*079o!9o9o!!9o!*029o9o!*029o9o!*089o!9o!*0r9o!*0m=9o!!9o9o!*2p",
|
||||
},
|
||||
{
|
||||
name: "Calibri Light",
|
||||
lineHeight: 1220.703125,
|
||||
descent: 268.5546875,
|
||||
regular:
|
||||
"3y565Y7O7Xb3au3m4H4H7O7O3R4O3R5G7X*0947477O*027fdY8P8n8n9v7F7c9P9H3Q4V7U6zdd9+ae7Yaq8k757z9Y8GdN7R7l7f4F5G4F7O7O4u7n886F887K4H7l883t3C6V3tcn888988885p6359886UaX6y6V6a4H754H7O3y567O7X7O7X7O7O5Yd26b7O7O4O7X6c5h7O5f5e4v8u943R4S3P6w7O9Nalal7f=8P*04bR==7F*02=3Q*029E==ae*037Oae=9Y*02=7Y80=7n*04c4==7K*02=3t*028888=89*037O89=88*02=88=*0f8F9E8u=*0jaf8d=*083t8J73=*036V=*043N8q5r6I3L=*058I9J88=*05dvdm=*0g5g7z5f=*0m3G8p9d8g888q8a8n8u6K9Eaq8g877I7F9F7j7c4H9S8uci4t4v7U6V4771dn9+8laeat8pbMa28P88827e6l755X597O597zaZ93ah8z7A7b7w6g7F7F6P6u7O7s6i6a7I3L6z8m56gEfIehb8a973eTdAbK=*0f7K=*05a37k=*03af=af==6P=gEfIeh==el8+=*0z7K75==9w9N8r867f6a=*0d549O5o3Cc2c29a8p6/6y7z6c5Q5S5O8la38N7F7P534u9N888u5y8f7g7n88*026I6F88887K7K9m77778y7Y4988887M6N6U88*02494c4A5t4d3t8ycn*0288898y86ayaD9N5p*044Y4Y7d7w633t4d3s3y594N8I8c6I6UaD6V6k6f6u6P6W5S5S6d6Uak7n7Y7+8h3M6V5m8c6060cvdccAaj8vaYcK999B978b88885D5C2I3P3Q415h7w4P3q5H3U3D3U5h5r4N4N6L6M6P6P67673Q6c4v4u3Q6c4u4v5M5M5h5B5k*035W3t4Z4T767c4N5l4Q2B4f4I3+7x*048C8C6P9I6p7Q*036i4u6W7c76476A*0364647f8M7n7z5Y3R3R9Y8j!!4y6I6F6F=4V!*033S7C8P=7F9H3Q!ae!7Faf4c8P8n6z8J7F7f9Hae3Q7U8Ndd9+7Iae9H7Y!757z7lbw7Rbfaf==8G778l4c8q8G8b6P87775i8l8c4c6V728u6R5P898r7N6t8d608q9N6taPaJ=*047U848E7V8w=9Nbp8Ra589706t7c6t6l768V91dncn8l7+8S7z7c6M8s84967x7v6L8s7R6F3Cak6/6+7Y888ncLa27X8n8p8p7F7F9G6I8E753Q3Q4Vdrdy9y8k9Y849D8P8g8n6I9Q7Fcf7l9Y9Y8k9pdd9Hae9F7Y8n7z84aH7R9S8AdldB9qbC878Fds8x7n8l7n5l8x7Kan6A8j8j6/7Rag8h8981886F626V9k6y8i7ab6bm8ca1786+b17d=7K8l=6/633t3t3CbxbQ8d=*0287cSaJ9J80cja68Z7UcBaLbh9/encJ7m6AbfaPae86927j==h7f2ae89cSaJcSaJ8g6p8C00*06ac8z9J807Y886M5r6Q5R896XcLaU7l6A8T7w8E7a8F759H889X8xb29pdJbtas8e8n6F7z627l6V7l6V8x6Ya+9j8Q7q8N7k8i88aN9gaN9g3Q==8k709F869H8h9X8x8A7adtaN3Q=*03bRc4==9F7K=*057F6P=*05ae86=*0b6M5l==6Q5R8x6Y896I=*2p7n=4H4H9v87=*0Vat8pat8pat8pat8pat8p=*03aZ93aZ93aZ93aZ93aZ93=*079j6m8l7k846V7QfE7Oe94K3y2m8r3p1i1Z00*044O4O7X7Oe9e97E7O3R*036p*026q7O*02!*02aD!*0200*043yg1!3q5H7Y!*02675g5g!8W7o7O!*0456!*0o4c3u00*04!00*09642D!!5w585B4+5A5B5N5H5y3m3m5B643P5f5e5w585B4+5A5B5N5H5y3m3m!595g5C4I5g!*0a8E9d8+7l7Wcnb7gPdjeHbl7G7X857zfVaE8WaK9y8Y8M!!82717X9Xaf7Xa99a!*0f00*0w!*0jbV!*0c7F!!fRd2!*07aV!aV!*02=!*06bz!*027c!*0pb85G!*03apb6apb6aZb69Yawa9aJaJ9O5D!*0y8n6I!*0ae9*03jYcee9*03!*0dce!*1o8i!*028J!*07cF!8o7O!!56!*023R7O!*02dtbq!*08b3!5E!*0r7O!*0m=7O!!7O7O!*2p",
|
||||
italic: "3y565Y7O7Xb3au3m4H4H7O7O3R4O3R5G7X*0947477O*027fdY8P8n8d9v7F7c9P9H3Q4V7U6zdd9+a77Yah8k6Z7z9Y8GdN7R7l7f4F5G4F7O7O4u7X7X6y7X7m4H7X7X3t3C6V3tcg7X7W7X7X5i63597X6NaX6y6P6a4H754H7O3y567O7X7O7X7O7O5Yd26F7O7O4O7X6c5h7O5f5e4v8i943R4S3P6w7O9Nalal7f=8P*04bR==7F*02=3Q*029E==a7*037Oa7=9Y*02=7Y80=7X*04bK==7m*02=3t*0288==7W*037O89=7X*02=7X=*0f8p9E8u=*0jaf80=*083t8J73=*036V=*043N8q5r6I3L=*058v9J7X=*05dvcJ=*0g5g7z5f=*0m3G8b9d8g7W8q7Z8p8u6C9Eaq8g7X7I7F9F7j7c4H9S8uci4t4v7U6V4771dn9+89a7ak7/bMa28P7X827e6m755X597O597zaZ8Jah8z7A7b7w6g7F7F6P6u7O7s6i6a7I3L6z8m56gEfIe5b8a973eTdAbx=*0f7K=*05a383=*086P=gEfIe5==el8+=*0z7K75==9w9B8r867f6a=*0d549O5o3Ccpcp9a8d6/6y7z6c5Q5S5O8la38N7F7m534u9N7W8u5y8f7g7n7X7X886x6F7X7X7o7o9577778y7Y497W7X7M6N6U7X*02494c4A5t4d3t8ycg*027X7Z8t7XaraD9N5i5h5h5i5i4Y4Y7d7w633t4d3s3y594N8w8c6I6UaD6V6k6f6u6P6W5S5S6d6Uaa7n7Y7+883M6V5m806060c4d0cfak8vaYcw9a9B978b88885u5C2I3L3Q415h7w4P3q5H3U3D3U5h5r4N4N6L6M6P6P67673Q6c4v4u3Q6c4u4v5M5M5h5B5k*035W3t4Z4T767c4N5l4Q2B4f4I3+7x*048C8C6P9I6p7Q*036i4u6W7c76476A*0364647f8M7n7z5Y3R3R9Y8j!!4y6x6y6x=4V!*033S7C8P=7F9H3Q!a7!7Faf4c8P8n6z8J7F7f9Ha73Q7U8Ndd9+7Ia79H7Y!757z7lbx7Rbfaf==8G77894c8q8G886P87775i898E4c6V728i6R5P7W8r7N6t8d608q9R6taPaJ=*047U888E7V8w=9Nbp8Ra57Y706t7c6t6l768V91dncf8l7X8S7z7c6M8s84967x7v6L8s7R6y3Ca76/6+7Y7X8dcLa27X8p8d8p7F7F9G6I8E6Z3Q3Q4Vdrdy9y8k9Y849D8P8g8n6I9Q7Fcf7l9Y9Y8k9pdd9Ha79F7Y8d7z84aH7R9S8AdldB9qbC878Fds8x7X8l7n6m897mbX6A7X7X6/7Rag887W7X7X6ycg6PaN6y8c7ab+cg8ca1746+b07d=7m8h=6/633t3t3CbxbQ80=*027XcSaJ9J80cja68Z7UcBaLbh9/encI7m6AbfaPa77X917j==gTeta77WcSaJcSaJ8g6y8C00*06ad8c9J807Y7X6M5r6Q5R896XcLbH7l6A8T7w8E7a8F759H889X8xb29pdJbtas8e8p6y7zcv7l6V7l6V8x6Ya+9j8Q7q8N7a8i7XaN8UaN8U3Q==8k709F869H889X8x8A7adtaN3Q=*03bRbK==9F7o=*057F6P=*05a77X=*0b6M6m==6Q5R8x6Y896I=*2p7X=4H4H9v87=*0Vak7/ak7/ak7/ak7/ak7/=*03aZ8JaZ8JaZ8JaZ8JaZ8J=*079j6m8l7k846P7QfE7Oe94K3y2m8r3p1i1Z00*044O4O7X7Oe9e97E7O3R*036p*026q7O*02!*02aD!*0200*043yg1!3q5H7Y!*02675g5g!8W7o7O!*0456!*0o4c3u00*04!00*09642D!!5w585B4+5A5B5N5H5y3m3m5v643P5f5e5w585B4+5A5B5N5H5y3m3m!5u515t4I57!*0a8E9d8+7l7Wcgb3gPdjeHbl7G7X857zfVaE8WaK9y8Y8M!!82717X9Xaf7Xa99a!*0f00*0w!*0jbJ!*0c7F!!fPd2!*07aV!aV!*02=!*06bz!*027c!*0pb85G!*03apb6apb6aZb69Yawa9aJaJ9O5D!*0y8p6x!*0ae9*03jYcee9*03!*0dce!*1o8i!*028J!*07cF!8o7O!!56!*023R7O!*02dtbq!*08b3!5E!*0r7O!*0m=7O!!7O7O!*2p",
|
||||
},
|
||||
{
|
||||
name: "Aptos",
|
||||
lineHeight: 1220.703125,
|
||||
descent: 281.73828125,
|
||||
regular:
|
||||
"3b4B5O8p8mcWa33i4B4B798m4u5k4u5j8m*094u4u8m*027Rd/9d9saQaK8I8cb4b3445b8U7Qcmb2bs91bs9u8S7vaF99dY8F8s844C5j4C8m7c8E8j8N8d8N8f4J7A8D3L3L7D44dl8D8E8N8N5e7C538L74bh6W746S4C4e4C8m3b4v8m*034e7m8EbJ6J6w8m5k7k8E5J8m5k5k8E8P8M4u8E5k6/6wb5bVcb7R=9d*04eB==8I*02=44*02aK==bs*038mbs=aF*02=918t=8j*04dd==8f*02=3L*028E==8E*038m8E=8L*02=8N=*0gaK8N=*0jb38D=*083L9g7u=*037D=*057Q4t7Q44=*059ob28D=*05gAdZ=*0h7v53=*0m4g!aR!*03aQ!!aKc7!*028Jb68X8c4J!89!*028U7D!*05b/8L!*0cbO9m!aF8J8O!!8P!*0A8f!*07==!!==!*0b=*07!*0n=*03!*0l==!*023L!*0q8N8d!8N8+!8f!7M!*067d!*0u3/!*068Y!*057A!*0O8E8E!*0f8E*05!*0x6v5B8C7Q3N3Nb28/!!5t8d*024e5b!*038E8E9d4v8Ib344!bs!8sbu459d9s7g9e8I84b3bs448U99cmb28PbsaV91!7Q7v8sbu8Fb/bu==8Q7M8D458R8Q8y748E7M6w8D8B457D748P746v8E988N6I946F8Rav7ca+cw=*048U8y8B8z*02av9896bs8E9r738c7a887F9q9He3dl9d8D9P8L907Z9e87aM8B8i6U968N8d3Lbs5+8d918NaQcmal8NaRaQaQ8I8Ibx7gaQ8S44445bfdeWbx8Ub28zaV9d9s9s7gar8Idx8Xb2b28Uagcmb3bsaV91aQ7v8zbu8Fbb9QeieAb2cn9saUeR9u8j8E7X5U8Y8fbj7D8/8/7D8jal8R8E8H8N8d6l74av6W8+8yd0dk97aq7I8dc87Q=8f8D=8d7C3L*02bxc38D=*028Hevbhaj7IevbTaf7RdYbebDa3fndm8w7ib/a+bs8E9y7Q==hBf1bx8SevbhevbhaG889o00*06bk9c9z7S918N7g5U7g5Z9P8bedbP8X7D9A8c8U7J8U7DaA9qbl98cKaCg0cSbm91aQ8d7v6l8s748s749c7mcWa6a68R9Q8y9Q8Dd99xd99x44==9A8say8wb38Rbk929Q8ycBay44=*03eBdd==b68f=*058P7A=*05bs8E=*0b7g5U==7v5U8D758F6W!*1x==!*0r=*05!*0nat!=*0Vb/8Lb/8Lb/8Lb/8Lb/8L=*03bO9mbO9mbO9mbO9mbO9m=*07!*0g00*04!5k!7ceoeo!7c4e*03747575!77777m!*02cO!*0200*04!i1!3j5D!*043N3N!8g827c!*042f!*0q00*04!00*095k!*025k*05!*046Z5k*09!*0l8R8v*028maa8U8mgjdZc38v8m8G8vhnbk8v9s8C928v8vbB8m*02d1ar8m8C8m8m!*0e00*0w!*0jdI!*0c9m!!hgbJ!*078/!8d!*02=!*06cT!*03jR!*0ubNcSbGcS*02bGcSbNcScSbx!*0M9o*03e48l9o*03!*0d8l!*1o8E!*029e!*07aV!7Q8m!!5j!*027MaL!*02br8W!*088W!6c!*098m!*0g8m!*0m=8m!!8m8m!*2p",
|
||||
bold: "3b4B6A8p8md9aB3E4B4B798m4I5k4I638m*094I4I8m*0286e49I9Hb3b38Z8pbebp4C5L9L80cRbjbx9tbx9W9m7VaU9FeI9n9a8z5h635h8m7c8E8E9a8B9a8I5f7/934c4c8m4EdV938Z9a9a5N845z967KbV7L7K7i5h4e5h8m3b4I8m*034e7P8EbJ6+6Z8m5k778E5W8m5C5C8E999H4I8E5C7h6ZbVcocG86=9I*04f1==8Z*02=4C*02b3==bx*038mbx=aU*02=9t8O=8E*04dE==8I*02=4c*028Z==8Z*038m8Z=96*02=9a=*0gb39a=*0jbp93=*084cal8o=*038m=*05805Q804E=*05arbj93=*05gjeb=*0h7V5z=*0m4N!bF!*03b3!!b3d1!*028Zbr9b8p5f!8+!*029L8m!*05cw9p!*0ccEaj!aU9c9c!!98!*0A8I!*07==!!==!*0b=*07!*0n=*03!*0l==!*024c!*0q9a8B!9a9w!8I!8b!*068a!*0u4E!*069g!*057X!*0O8E8E!*0f8E*05!*0x6O6a9+8u4a4abj9s!!7J8B*024G5L!*038E8E9I=8Zbp4C!bx!9abE4E9I9H7B9O8Z8zbpbx4C9L9FcRbj9abxbf9t!8g7V9acr9nd3bE==9j8b934E9a9j8W7K8Z8b7793964E8m7K997K728Z9r9a7h9n6X9abr7Zc2dj=*049L8W969k*02br9r9Nbx8Z9W7H8p7K8A8p9A9Qf0dV9W8/au969w8v9O8Rb68Q9L8a9N9a8B4cbx6r8B9t9ab3cRb59ab3*028Z8Zc87Bb39m4C4C5LfEf9c89Lbj9mbf9I9H9H7Bbs8ZeG9bbjbj9LaVcRbpbxbf9tb37V9mcr9nbRaufefPbpde9Hb7fs9V8E8/8l679Y8Ich869s9s8m8Kb59h8Z979a8B707Kbr7L9K8Xdre29sbl858BcL8n=8I93=8B844c*02bZcw93=*0297f5ceaO85facxb28PfacCcNaXhceH8T7Gd3c2bx8Z9N8e==imfYbM9Ff5cef5ceaX8y9o00*06bV9/a08m9t9a7B677B6mat8FfecS9b86ai919L8E9L8mbpa9b/9Ud2aZgvdobH9kb38B7V709a7K9a7Ka18fdvaDb49xau8Xau93dOamdOam4C==ar94bx9ibp9hc09Rau8XdlbF4C=*03f1dE==br8I=*05987X=*05bx8Z=*0b7B67==7H679d7L9n7L!*1x==!*0r=*05!*0nbo!=*0Vcw9pcw9pcw9pcw9pcw9p=*03cEajcEajcEajcEajcEaj=*07!*0g00*04!5k!7ceoeo!7c4G*03878888!7I7I7E!*02di!*0200*04!ix!3E6k!*043Y3Y!8F8G7c!*0427!*0q00*04!00*095C!*025C*05!*047m5C*09!*0l9J8M*028ma39p8mheeJdp8M8m948MiZcD8M9s969a8M8Mct8m*02d9at8m968m8m!*0e00*0w!*0jdF!*0c9h!!hQbJ!*079f!8t!*02=!*06cT!*03mc!*0ucldjcidj*02cidjcldjdjc7!*0M9o*03e48n9o*03!*0d8n!*1o8Z!*029O!*07bf!8g8m!!63!*028jb4!*02bZ8W!*088W!6q!*098m!*0g8m!*0m=8m!!8m8m!*2p",
|
||||
italic: "3b4B5D8p8mdGak364B4B5Z8m4e5k4v5j8m*094v4e8m*027RdV9d9yaVaJ8I8vb4b3445b8N7Pcmb2bs9fbs9u8S7vaF98dZ8F8s7Z4A5j4x8m7c8E8k8N8i8N8i4w7A8D3D3D7E44dm8D8E8N8M5d7B4V8D74bh6W746S4/4e4/8m3b4B8m*034e7p8EbJ6J698m5k7t8E5J8m5k5k8E8P8I4v8E5k6/69bucBdk7R=9d*04dV==8I*02=44*02aJ==bs*038mbs=aF*02=9e8G=8k*04de=8i*033K*038E==8E*038m8E=8D*02=8N=*0gaJ8N=*0jb38D=3K=3K=3K=3K=3K9f7e=3J==7E=*05874t7P44=*059ob38D=*05gBdY=*0h7v4V=*0m43!aY!*03aV!!aJc5!*028Jb38S8w4w!84!*028N7E!*05bN8S!*0cbO9p!aE8H8O!!8U!*0A8j!*07==!!==!*0b=*07!*0n=*03!*0l==!*023J!*0q8N8j!8N8+!8j!82!*067d!*0u3/!*068Y!*057J!*0O8E8E!*0f8E*05!*0x6v5w8B7B3N3Nb290!!9o8c8i8c=5b!*038E8E9d=8Ib344!bs!8sbr439d9y7v8Y8I7Zb3bs448N99cmb28PbsaV9f!7J7v8sbR8Fb/br==8P828D438Q8P8E748H826J8D8B437F748P746v8E8/8O6E946r8Qav7ca+ct=*048N8E8B8z*02av8/90bs8E9n718v74887F9q9He4dn9o8L9Q8K97858Y88aF8z8h6K908N8i3Dbs618c9e8NaVcmal8OaV*028I8Ibz7vaV8S44445bfbf4by8Nb28raV9d9t9y7var8Idi8Ub2b28Nahcmb3bsaV9faV7v8rbR8Fbb9QeheAbdcn9vaSf09B8k8F7W5J8Z8ibm7D8D8D7E8kal8R8E8I8N8idm74av6W908ydndI96al7H8eci7C=8i8D=8i7B3D3K3Dbzc48D=*028De+bhak7IeBbY9U7RdXbebxa6f7du8E7pb/a+bs8E9y7Q==hyf1bs8Ee+bhe+bhaC8e9o00*06bm8P9v7O9f8N7v5r7v5I9t8ae9bV8U7D9t8b8N7E8N7Eav9mbb98cMayg1cRbn90aV8i7v6d8s748s749c7pcVad9W8U9Q8y9Q8Dd99zd99z44==9A8say8wb38Rbh929Q8ycAay44=*03dVde==b38j=*058U7J=*05bs8E=*0b7v5J==7v5N8F748F6W!*1x==!*0r=*05!*0nay!=*088l=8l=*0i8j=*028j=*043K=*0fbN8SbN8SbN8SbN8SbN8S=*03bO9pbO9pbO9pbO9pbO9p=*07!*0g00*04!5k!7ceoeo!7c4e*03747475!6R6R7m!*02df!*0200*04!iU!365D!*043q3q!8g837c!*042z!*0q00*04!00*095k!*025k*05!*046+5k*09!*0l8R8v*028maa8H8mgidZc38v8m8v8vhibg8v9s8C8v*02bO8m*02dQaa8m8C8m8m!*0e00*0w!*0jdH!*0c9o!!hgbJ!*078+!8g!*02=!*06cT!*03iN!*0uczdbcDdb*02codbc4dbdbbX!*0M9o*03e48l9o*03!*0d8l!*1o8E!*028Y!*07aV!8P8m!!5j!*027MaW!*02br8W!*088W!4F!*098m!*0g8m!*0m=8m!!8m8m!*2p",
|
||||
boldItalic:
|
||||
"3b4B6k8p8mefaR3n4B4B6J8m4G5k4I638m*094I4G8m*0284e19I9Qb8b38Z8Ibebp4C5K9z80cRbjbx9Ibx9W9m7WaU9EeJ9n9a8s5a63518m7c8E8J9b8H9b8N557/934a4a8j4EdV938Z9b995K845p947KbV7L7K7i5q4e5q8m3b4B8m*034e7Y8EbJ6+6w8m5k7g8E5W8m5C5C8E9a9u4I8E5C7g6wcodge284=9I*04eh==8Z*02=4C*02b3==bx*038mbx=aU*02=9H90=8J*04dy==8N*024c*038Z==8Z*038m8Z=94*02=9b=*0gb39b=*0jbp92=4c=4c=4c=4c=4cal8k=4c==8k=*058j5Q804E=*05arbj93=*05gjea=*0h7W5p=*0m4C!bP!*03b7!!b3d1!*028Zbp9f8I55!8Y!*029z8j!*05ca9k!*0ccEar!aU999c!!9d!*0A8O!*07==!!==!*0b=*07!*0n=*03!*0l==!*024c!*0q998H!9b9w!8O!8p!*068a!*0u4E!*069g!*0583!*0O8E8E!*0f8E*05!*0x6O5/9+8g4a4abj9s!!9o8B8I8B=5K!*038E8E9I=8Zbp4C!bx!9abJ4E9I9Q7I9C8Z8sbpbx4C9z9FcRbj9abxbf9I!887W9acS9nd2bJ==9d8p934E9a9d8Y7K958p7e93964E8k7K9a7K728Z9h9d7f9n6L9abs7Zc1di=*049z8Y969k*02bs9h9Qbx8Z9R7F8I7z8D8r9A9Qf2dWa795au969C8s9C8Qb48S9M7R9Q9a8H4abx6t8B9H9bb8cRb69db7b8b78Z8Zca7Ib79m4C4C5Kfufgc89zbj9jbf9I9M9Q7Ibt8Zei9cbjbj9zaWcRbpbxbf9Ib87W9jcS9nbRaufdfPbwde9Mb5fB9Y8J8/8l659Y8Ncc8194948k8Mb69i8Z989b8HdV7Kbs7L9Q8XdWeB9Bbp878EcW89=8N92=8H844a4c4ac6cF93=*0294fhcfaJ86ffcDaV8Of8cDcDaSgOe+917Ud2c1bx8Z9N8e==ikfYbx8+fhcffhcfaT8E9o00*06c79B9M8t9I9b7I5U7I63a68Gfid09c81ak979z8k9z8jbna2bR9Udaa+gxdpbH9mb88H7W719a7K9a7Ka18idvaFaV9Eau8Xau93dOaodOao4C==ar96bv9ibp9ica9Rau8XdCbG4C=*03ehdy==bp8O=*059d83=*05bx8Z=*0b7I65==7H649f7H9n7L!*1x==!*0r=*05!*0nbq!=*088K=8K=*0i8O=*028O=*044c=*0fca9kca9kca9kca9kca9k=*03cEarcEarcEarcEarcEar=*07!*0g00*04!5k!7ceoeo!7c4G*03878788!7q7q7E!*02ds!*0200*04!jJ!3n6l!*043v3v!8u8H7c!*042I!*0q00*04!00*095C!*025C*05!*047n5C*09!*0l9J8M*028ma39k8mheeJdp8M8m8M8MiYcz8M9s968M*02cF8m*02dVaa8m968m8m!*0e00*0w!*0jdH!*0c9o!!hPbJ!*079b!8B!*02=!*06cT!*03kS!*0ud9dUdmdU*02dhdUdadUdUd2!*0M9o*03e48n9o*03!*0d8n!*1o8Z!*029C!*07bf!988m!!63!*028jbh!*02bZ8W!*088W!55!*098m!*0g8m!*0m=8m!!8m8m!*2p",
|
||||
},
|
||||
{
|
||||
name: "Aptos Narrow",
|
||||
lineHeight: 1220.703125,
|
||||
descent: 281.73828125,
|
||||
regular:
|
||||
"2X565j7O7XbV9c304M4M7O7X444O444V7X*0944447X*0277cC8m8F9V9P7Z7wa6a63P4N8a79bia5ar8har8H876Q9J8jcJ7V7J7m4f4V4f7X6w7P7D827v827B4m727X3w3w703Pcg7X7V82824R6X4E7+6uag6m6u6f4f7e4f7X2X567X7X7O7X7e6J7PaC6o5X7X4O6F7P5J7X59597W8484457P596z5XaKbwbI77=8m*04dh==7Z*02=3P*029P==ar*037Xar=9J*02=8h7N=7D*04c2==7B*02=3w*027U==7V*037X7V=7+*02=82=*0g9P82=*0ja67X=*083w8A70=*0370=*057a4p793P=*058ra57X=*05f2cF=*0h6Q4E=*0m3W!9X!*039W!!9Pb5!*027Za7897t4m!7s!*028a70!*05aV83!*0caM8C!9J7X7/!!83!*0A7B!*07==!!==!*0b=*07!*0n=*03!*0l==!*023w!*0q827x!828c!7B!75!*066E!*0u3H!*068d!*056T!*0O7P7P!*0f7P*05!*0x5Y5a7/793t3ta58h!!5b7x*023T4N!*037Q7Q8m=7Za63P!ar!7Jaq3P8m8F6F8s7Z7ma6ar3P8a8lbia585ar9Z8h!786Q7Jax7Vb1aq==85757X3P86857R6u7V755/7X7T3P706u846u5Z7V8j83698g63869F6Ca8bt=*048a7R7T7Q*029F8j8lar7V8D6u7w6A7t738x8NcUcd8t7W91818g7l8s7r9R7R7F6m8m837v3war5v7x8h829Vbi9w839W9V9W7Z7Zax6F9V873P3P4NdRdAax8aa57P9Z8m8E8F6F9z7Zcm89a5a58a9obia6ar9Z8h9V6Q7Pax7Vae91d5dma2bm8E9Ydz8H7D7V7g5q8c7Bal6+8h8h707D9y877V7+827v5S6u9F6m8f7TbUca8m9L747xb67c=7B7V=7v6X3w*02axb27X=*027+dgaj9u73dhaU9k7dcNamaD9ce8cg7M6Fb1a8ar7V8F77==g2dMaw89dgajdfaj9L7t8u00*06ai8q8K7d8h826F5q6F5w907wcZaO896+8L7w8a768a709S8Pal8pbA9HeBbLam8i9V7v6Q5Q7J6u7J6u8q6LbQ9d9g89917S917Xc08Tc08T3P==8P7N9D7Oa687ak8j917Tbu9J3P=*03dhc2==a77B=*05836T=*05ar7V=*0b6F5q==6Q5o7S6v8v6m!*1x==!*0r=*05!*0n9D!=*0VaV83aV83aV83aV83aV83=*03aM8CaM8CaM8CaM8CaM8C=*07!*0g00*04!4O!6wd0d0!6w3T*036I*02!6v6v6H!*02co!*0200*04!gz!315a!*043s3s!8L7m6w!*0420!*0q00*04!00*0959!*0259*05!*046s59*09!*0l857J*027X9i887XeTcIb47J7X7U7JfVaq7J8E7Q8g7J7LaE7X*02b/9u7X7S7X7X!*0e00*0w!*0jcs!*0c8u!!fQaC!*078a!7u!*02=!*06cU!*03ij!*0ub9cib9ci*02bbcibicicibb!*0M9o*03e48n9o*03!*0d8n!*1o7R!*028s!*079Z!787X!!4U!*02749R!*02ap7O!*087O!5Q!*097X!*0g7X!*0m=7O!!7X7X!*2p",
|
||||
bold: "2R565V7O7XbM9y3f4P4P7O7X4b4O4b5y7X*094b4b7X*027bb+8F8K9W9V837xa1ad4g5d8O7bbua6ai8wai8V8q729G8Bd88p8e7F4M5y4M7X6l7B7P8i7M8i7W4M7d8d3X3Y7y4fcC8d858i8i5g7b4/8d6ZaB6Y6Z6x4M7i4M7X2R567X7X7O7X7i6/7Baj6u6e7X4O6n7B5V7X5m5m868g8P4e7B5m6H6ebnc4ca7b=8F*04dm==83*02=4g*029V==ai*037Xai=9G*02=8w7U=7P*04cd==7W*02=3X*0281==85*037X85=8d*02=8i=*0g9V8i=*0jad8d=*083X9t7T=*037y=*057q5H7b4f=*059ca68d=*05ercD=*0h724/=*0m4i!aw!*039W!!9VbH!*0282a98d7t4M!84!*028O7y!*05b88z!*0cbh9e!9G8d8c!!8c!*0A7W!*07==!!==!*0b=*07!*0n=*03!*0l==!*023Y!*0q8i7M!8i8w!7W!7h!*067k!*0u4d!*068o!*0571!*0O7B7B!*0f7B*05!*0x685B977A3K3Ka68A!!7a7M*02=5d!*037B7B8F4b83ad4g!ai!8eaj4e8F8K6Q8O837Fadai4g8O8Dbua68gaia48w!7o728ebc8pbLaj==8n7h8d4e8g8n836Z857h6p8d8b4e7y6Z8g6Z6k858n8i6A8n6b8gan7caYbY=*048O838b8o*02an8n8Vai858T6Y7x6Z7M7G8s8Gdvcv8W889s8e8z7D8O7Y9Z7Y8R7o8X8i7M3Yai5Q7M8w8i9Wbua38i9W*028383aR6Q9W8q4g4g5ddYduaR8Oa68sa48F8H8K6Qah83d68ea6a68O9Nbuadaia48w9W728sbc8paA9sdGeaa8bV8H9YdQ8U7P857x5z8W7WaZ7h8A8A7y7Vab8p858h8i7M6k6Zan6Y8N85c3cz8Aax7o7Mbu7z=7W89=7M7b3X3X3YaNbm8d=*028hdva+9M7ndCbm9S7ZdEbrbo9Nfydg7U6PbLaYai858E7k==gnelav8Mdva+dva+9N7L8g00*06aB8Z8+7D8w8i6Q5z6Q5O9r7Sdxbw8e7h99858O7O8O7yas9maI8VbB9QeHc1as8A9W7M726j8e6Z8e6Z8W7pc89r9W8B9s7/9s8dck9xck9x4g==9q8dah8jad8paH8T9s85bTax4g=*03dmcd==a97W=*058c71=*05ai85=*0b6Q5z==6P5u8d6Y8Q6Y!*1x==!*0r=*05!*0naf!=*0Vb88zb88zb88zb88zb88z=*03bh9ebh9ebh9ebh9ebh9e=*07!*0g00*04!4O!6lcFcF!6l4b*037A7B7B!6M*02!*02cL!*0200*04!gx!3g5I!*043y3y!977Q6l!*041R!*0q00*04!00*095m!*025m*05!*046E5m*09!*0l8I7M*027X978x7Xfpd3c47L7X847Lh2bo7L8z858d7M7Tbd7X*02bN9g7X8c7X7X!*0e00*0w!*0jca!*0c8b!!g1aj!*078g!7A!*02=!*06cW!*03kj!*0ubucxbxcx*02bEcxbFcxcxbD!*0M9o*03e48o9o*03!*0d8o!*1o7Y!*028O!*07a4!7o7X!!5s!*027p9T!*02aC7O!*087O!5Q!*097X!*0g7X!*0m=7O!!7X7X!*2p",
|
||||
italic: "2X565a7O7Xcx9r2R4M4M7O7X3T4P454T7X*09453U7X*027acK8n8K9Y9N7X7La6a63P4N8276bha4ar8tar8F846R9J8icJ7V7J7f4c4U497X6w7P7B827z867B496V7W3n3n703Jcd7W7U82844Q6W4v7W6uag6m6u6f4z7e4A7X2X567O7X7O7X7O6T7PaB675B7X4P6P7P5J7X59597P8983457P596l5Cb8b/cH7a=8n*04co==7X*02=3P*029N==ar*037Xar=9J*02=8s7X=7B*04b/==7B*023A*037R==7U*037X7R=7W*02=82=*0g9N86=*0ja67W=3A=3A=3A=3A=3A8z6L=3z==70=*057i4m763J=*058Fa07W=*05e/cE=*0h6R4v=*0m3K!a6!*039Y!!9Nb8!*027Sa5827K49!7m!*028170!*05aF84!*0caJ8D!9I7V7/!!84!*0A7z!*07==!!==!*0b=*07!*0n=*03!*0l==!*023z!*0q7Z7A!868a!7z!7j!*066E!*0u3H!*0688!*0571!*0O7P7P!*0f7P*05!*0x5W527W6X3t3ta48l!!8u7y*023T4N!*037P7P8n=7Xa63P!ar!7Jan3I8n8K6R8a7X7fa6ar3P828kbha47Xar9Y8t!716R7JaP7Va/an==7/7j7W3I7/7/7R6u7U7j677W7Q3I716u896u5X7U8d81638f5S7/9E6Ba2bj=*04827R7Q*039E8d8jar7U8z6p7L6v7s728x8NcTce8z808+808j7o8a7q9L7P7F688f7Z7z3nar5v7y8s829Ybh9A819Y9Y9Z7X7Xay6R9Y843P3P4NdPdIax82a47K9Y8n8F8K6R9z7Xc383a4a4829mbha6ar9Y8t9Y6R7KaP7Vad90c/dlacbm8G9QdI8K7B7W7h5k8d7Bah6Z7W7W707I9A8b7U83827zcd6u9E6m8d7Tcdcu8s9D747ybk73=7B7T=7z6W3n3A3naAb47W=*027WdAaj9u74dka+937ccLamav98dVco7S6Qa/a2ar7T8F77==fZdBar7UdAajdAaj9I7v8u00*06am818G7a8t826R516R5g8F7xcYaX836Z8H7D827482709N8Mac8obB9HeCbMan8j9Y7z6R5O7J6u7J6u8k6QbN9i9587907V907Wc38Nc38N3P==8O7N9F7Oa58bao8j907Tbz9I3P=7C==cob/==a57z=*058471=*05ar7T=*0b6R5k==6P5k7U6u7V6m!*1x==!*0r=*05!*0n9F!=*087D=7D=*0i7D=*027D=*043A=*067V=*07aF84aF84aF84aF84aF84=*03aJ8DaJ8DaJ8DaJ8DaJ8D=*07!*0g00*04!4P!6wd0d0!6w3T*036I*02!6k6f6H!*02ca!*0200*04!he!2V5e!*043536!8M7q6w!*042p!*0q00*04!00*0959!*0259*05!*046m59*09!*0l857I7J7J7X9f7W7XeUcJbn7J7X7I7JfTal7I8y7Q7J7J7LaM7X*02cL9e7X7Q7X7X!*0e00*0w!*0jcp!*0c8v!!fEaN!*0789!7w!*02=!*06cT!*03hg!*0ubUcHbScH*02bRcHbKcHcHbF!*0M9o*03e48l9o*03!*0d8l!*1o7R!*028a!*079V!807X!!4U!*02749V!*02ax7P!*087O!4G!*097X!*0g7X!*0m=7O!!7X7X!*2p",
|
||||
boldItalic:
|
||||
"2R565H7O7Xco9E304P4P7O7X4b4P4b5n7X*094b4b7X*027dcv8B8O9T9Q7Y7J9Ya84c5a8A75bpa1ac8Eac8Q8l729F8xd48n8b7w4E5s4w7X6l7B7M8e7L8i7Q4A768a3O3O7u49co8a7/8f8i5b7a4R8a6VaB6Z6V6u4Q7i4Q7X2R567O7X7O7X7O7d7Baj6c5O7X4P6u7B5V7X5m5m7B8j8C4b7B5m6r5ObFcwc+7d=8B*04cp==7Y*02=4c*029Q==ac*037Xac=9F*02=8D83=7M*04c1==7Q*023Y*037Y==7/*037X7Y=8a*02=8f=*0g9Q8i=*0ja889=3Y=3Y=3Y=3Y=3Y9l7A=3X==7u=*057i5u7549=*059t9+89=*05ekcv=*0h724R=*0m49!aK!*039U!!9QbL!*027Sa8897I4A!7/!*028y7u!*05aL8j!*0cbe9m!9E888a!!88!*0A7P!*07==!!==!*0b=*07!*0n=*03!*0l==!*023X!*0q877M!8i8s!7P!7t!*067m!*0u4c!*068f!*0579!*0O7B7B!*0f7B*05!*0x615n907o3K3Ka18A!!8g7K7J7K=5a!*037C7C8B=7Ya84c!ac!8bal488B8O6Q8A7Y7wa8ac4c8A8zbpa182ac9/8E!7d728bbs8nbIal==8b7t8948888b7V6V837t6s8986487v6V8j6V6i7/8p8f6t8j5+88ai78aObP=*048A7V868k*02ai8p8Rac7/8N6R7J6O7I7C8s8Gdqco8+8a9m8a8y7w8z7T9S7V8Q6/8O887L3Oac5L7K8D8f9Tbpa58f9U9T9X7Y7YaQ6Q9U8l4c4c5adKduaP8Aa18l9/8B8F8O6Qag7YcG87a1a18A9Ibpa8ac9/8E9T728lbs8nay9odye8adbU8F9MdO8Q7M817v5z8W7QaN7b8a8a7u7+a58r7/8i8f7Lco6Vai6Z8N83coc/8Las7n7HbG7p=7Q86=7L7a3O3Y3OaUbp8a=*028aduaX9C7ldzbl9M7Vdybpbc9Af4dt7/76bIaOac7/8E7j==ghe6ac7/duaXduaX9G7J8g00*06aN8y8F7G8E8f6Q5l6Q5u907QdGbH877b9f8h8A7G8A7uan9caw8TbG9TeGb/an8D9T7L726p8b6V8b6V8U7uc59s9M8C9o8a9o8acm9kcm9k4c==9l8dah8ja88raW8R9o83cbav4c=7R==cpc1==a87P=*058879=*05ac7/=*0b6R5z==6P5v8e6V8n6Z!*1x==!*0r=*05!*0nad!=*067N=7O=7O=*027N=7N=*027N=*087X=*027X=*043Y=*0684=*07aL8jaL8jaL8jaL8jaL8j=*03be9mbe9mbe9mbe9mbe9m=*07!*0g00*04!4P!6lcFcF!6l4b*037A7A7B!6J6D6N!*02cm!*0200*04!h7!365N!*043435!8X7R6l!*042u!*0q00*04!00*095m!*025m*05!*046y5m*09!*0l8H7L7M7L7X8X8j7Xftd4cj7M7X7L7Lh0bi7L8i857L7M7Tbh7X*02cA8+7X857X7X!*0e00*0w!*0jc3!*0c8g!!fLay!*078b!7D!*02=!*06cT!*03iP!*0uchdacpda*02ctdacwdadack!*0M9o*03e48n9o*03!*0d8n!*1o7Y!*028A!*079Z!867X!!5s!*027q9+!*02b97P!*087O!50!*097X!*0g7X!*0m=7O!!7X7X!*2p",
|
||||
},
|
||||
{
|
||||
name: "Trebuchet MS",
|
||||
lineHeight: 1161.1328125,
|
||||
descent: 222.16796875,
|
||||
regular:
|
||||
"4J5L558c8c9ob22w5L*028c5L*028c*0a5L5L8c*025Lc39e8S9m9B8o8daAae4m7t907Wb59+ay8KaA967x95a89bdk8J8W8C5L5z5L8c*028d8J7L8J8x5O7S8y4t5L7U4Dc+8y8p8J8J656l6c8y7GbE7R7J7r5L8c5L8c4J5L8c*028W8c768cb95L8c8c5Lb98c*0273768c8y8c5L8c735L8ccK*025L=9e*04dz==8o*02=4m*029B==ay*038cah=a8*02=8I8y=8d*04dF==8x*02=4t*028B==8p*038c8x=8y*02=8F=*0faP9B8J=*0jaF8A=*084tbn9q=*038x=*057W5a7W4G=*059Xad8y=*05fxes=*0g7M956c=*0m5b!*0h64!*1C=*05!*0n=*03!*2F8c8c!8c!*0d8c*05!*0L=!*048c8c9e5Ma6bY5P!bk!babC4m9e8S7+998o8CaeaP4m909ab59+9lay9X8K!8u958WbW8Jc5at==967j8C4m8D968Q8v8F7j6X8C8w4m8x8i8y7O7c8x9q8X7b8W6W8Db27ZbgbU=*04!*0N8vbp88997B4m4m7lfbehbC9A!919X9i8V8U88aP8vdZ8dawaw9AawbDaeay9X8K9d9H91by8Qab9ld+eobAce909bdQ9m818D846N928zbx768Y8Y848PaG8L8p8y8J7N757Nc97Z8D8jbSc49xaJ7W7Nbi8c!=8A=7N6q4q4q4NcUcl8A=!=8y!*0y00*06!*05886N!*3J=*05!*1H==!*0m00*045L5L!5Lbubu!8c5L*038c*02!7b7b8c!*02bu!*0200*04!eh!2w5j!*045L5L!9x!8c!*048h!*0q00*04!00*09!*0e67!*0y8d8c!!hq!*038c!*0y00*0w!*0jbP!*0c8c!!ei!*0a9X!*02=!*068B!*0HcK*03!*2y8B!*0299!*078F!8d8c!!8h!*025L8c!*028c!*0b8c!*0r8c!*0m=!*028c8c!*2p",
|
||||
bold: "4J5L5L9a9aaIb23B5L5L6M9a5L*02669a*095L5L9a*026Sc39V9j9Aa38V97avaI4m8l9F8FbFara/9bb59z7/9AaC9KdQ9p9B8M6i5z6i9a*028l9680958/5O7S9h4G5L8A4Ddr9e8S97986H6L6c9f8fcg8E8m8g6O9a6O9a4J5L9a8c9a8W9a769ab96J9a9a5Lb99a*0273769a8z8c5L9a736J9acK*026S=9V*04eD==8V*02=4m*02a3==a/*039aaI=aC*02=8K8y=8l*04dv==8/*02=4G*028S==8S*039a8S=9f*02=97=*0fbta395=*0jaZ9n=*084Gco9K=*038+=*045V8F6R8F4D=*05aHaG9e=*05fHep=*0g8x9A6c=*0m5F!*0h64!*1C=*05!*0n=*03!*2F9a9a!9a!*0d9a*05!*0L=!*049a9aa3=aNcA6b!c3!c7cq4y9V9j8x998V8MaIbe4m9F9RbFar9Ta/ao9b!969A9Bcr9pcKat==9i7Y9f4y929i9a8T8Y7Y7i9f914y8+8L8z8l7y8Y9q9f7v9l7n92bM8Jc5cf=*04!*0N90bP8C9A814m4m8yfKeRc0a0!9J9X9Z9m9l8Cbp90eB8Ja+bfa0aWcaaIa/ap9d9Aaa9Jcm9AaE9Veye+c8d79u9FeKa08m978x7e9N92cb7z9p9p8y9nbg9h8W9899847D8tct8M9q8TcrcSabbG8s8cbY8M!=9n=8c6Q4J4J5cdDd89n=!=9e!*0y00*06!*058C7b!*3J=*05!*1H==!*0m00*045L5L!5Lbubu!9a5L*039a9a8c!7b7b8c!*02bu!*0200*04!gc!365S!*045L5L!9x!8c!*049a!*0q00*04!00*09!*0e6m!*0y978c!!ia!*039a!*0y00*0w!*0jci!*0c9a!!f6!*0aa4!*02=!*068B!*0HcK*03!*2y9a!*0299!*079Z!8d9a!!9a!*025L9a!*029a!*0b8c!*0r9a!*0m=!*029a9a!*2p",
|
||||
italic: "4J5L558c7x9ob22w5L*028c5L*028c*0a5L5L8c*025Lc39z8S9m9B8o8daAae4m7t907WbV9+ay8vay967x95a89bdk8J8W8C5L5z5L8c*028d8J7c8J8p6h7S8J4P5L7U50c+8y8p8J8J6x6l6A8J7GbE7R7J7r5L8c5L8c4J5L8c8h8c8J8c768cb9758c8c5Lb98c*0273738c8J9n5L8c737b8ccK*025L=9z*04dz==8o*02=4m*029B==ay*038cay=a8*02=8v8y=8d*04dd==8p*02=4P*028B==8p*038c8p=8J*02=8J=*0faP9B8J=*0jaG8F=*084Pbn9a=*038p=*057W*024D=*059tac8y=*05fxdX=*0g7M956A=*0m5t!*0h6h!*1C=*05!*0n=*03!*2F8c8c!8c!*0d8c*05!*0L=!*048c8c9z=a6bO5T!bu!babT4d9z8S83998o8CaeaP4m909cbV9+9qay9Y8v!8u958Wb+8JbTat==8z7h8F4d8C8z8Q8e8z7h6V8F8S4d8p8g8J7R768w9q917o8/6M8CaZ82bAbW=*04!*0N8zbh878S7t4m4m7jflejbF9A!949+9z8W8W87aI8zdU86avav9xazbMaeaz9Y8N8Q9H94bJ8/a59kdXecbCc5908UdW9m8r928r769981bx748V8V8b95bw8Q8t8H8L78d97VbM829e8xd3dwa5bx8o7abt8g!=8D=786s4y4y4JdxcC8D=!=8T!*0y00*06!*05876T!*3J=*05!*1H==!*0m00*045L5L!5Lbubu!8c5L*038c*02!7b7b8c!*02bu!*0200*04!eh!2w5j!*045L5L!9x!8c!*048h!*0q00*04!00*09!*0e73!*0yeJ8h!!hm!*038c!*0y00*0w!*0jaW!*0c8c!!d+!*0a9X!*02=!*068B!*0HcK*03!*2y8B!*0299!*078F!8d8c!!8h!*025L8c!*028c!*0b8c!*0r8c!*0m=!*028c8c!*2p",
|
||||
},
|
||||
{
|
||||
name: "Georgia",
|
||||
lineHeight: 1136.23046875,
|
||||
descent: 219.23828125,
|
||||
regular:
|
||||
"3N5b6sa39ycNb63n5T5T7oa34e5S4e7l9C6K8L8E8R8g8S7S9k8S4V4Va3*027vexavaea2bJad9nblcL6686aS9sevb/bE9ybEa+8N9HbQarfgb69D9q5T7l5Ta3a37Q7U8M768+7z557Z964B4A8o4udN9f8r8X8M6q6M5p8/7Nbx7V7I6Y6K5T6Ka33N5b8H9K8X9D5T7Q7QeK7Q95a35SeK7Q6za37Q*02937Q4n7Q*0295gq*027v=av*04fb==ad*02=66*02bJ==bE*03a3bE=bQ*02=9C8A=7U*04bx==7z*02=4B*028k==8r*03a38r=8/*02=8L=*0fapbJ8+=*0jcL96=*084BdU8Y=*038w=*045U9s6A9s4u=*05a5b/93=*05fCcM=*0h9H5p=*0m4H!*0eaO!!87!*0ccPa2fCbv!*0adsa2!*039q6Y!*085T9s!5bl7iFfWhxe092k5gzdP=*048P=*09!=*05!!=*048P=8P!*02l7iFfW==!!=*0k8P=8P=*0b!!==!*05=*048P=8P=8P=8P==!*024A!*0w7z!*1w3z3z!*087Q7Q!7Q!*0d7Q*05!*0f6q!*0u=!*047Q7QaA4Vcuf08l!dk!cxdI4Davae97alad9qcLbE66aSayevb/aRbEcE9y!9s9H9Db/b6dHcb==9m7k8X4D8t9m8R828r7k6k8X8I4D8o7E937R6V8r9p8K6+8Z738taU7Wbqbb=*04!*069f!*0Eadadch97ah8N666686fQgFd8aTcOahcGavabae97biadfo9xcOcOaTbQevcLbEcE9ya29Hahb/b6cEbJhahabWf8a1aigGaV7U8t866U8M7zcj7q9A9A8D95bb9x8r9q8X767n7IbN7V9r8Ydvdw92bS7N7Ccm8A=7z8X=7C6M4B4B4Ac5cu96=*029r!!a17N!*05focj!*05bE8PbA8t!*0c00*06!!a17N!!906L976U!!gEcM9x7qbZ8+cD9O!!cF9Wdm9VeFaN!*03a276!!9D7N9D7NbC8j!!ck9kbJ8YbJ96!*0366==!*0c=*03fbbx==aO7z!!=*03!!=*048PbE8P!*03=*07!!g6cm!*05=*1c8P=8P=8P=8P=*15!*05=*0I8P=8P=8P=8P=8P=8P=8PcPa2cPa2cPa2cPa2cPa2=*03dsa2dsa2dsa2dsa2dsa2=*07!*0g00*04!5S!a3dpdp!a33z*02336q*02!7o7o69!*02cD!*0200*04!iS!5185!*046v6v!8/!a3!*041h!*0q00*04!00*097Q!*027Q*05!*048d7Q*09!*0o9K9K!!iR!*028+a2!*068N!*03a+!*0l00*0w!*0hgC!cN!*02fX!*0853!!j5eK!*07gO!eK!*02=!*02==!!9E!*0zgqgq!*05gq*03!66cbihgwargwmCsHhcb6hcni9sa2bJev4B9adLcu7NcmgXlvcu7Vcuh34u768+dN!*2190!*02as!*07d2!b1a3!!1h!*024nat!*02bd!*0b7Q!*0ra3!*0m=!*02a3a3!*1u4n!*0V",
|
||||
bold: "3+5U7+a/a1dLcv4d6/6/7ya/585X587oaZ7G9O9Na99na88GaAa85L5La/*028Af7bSbRbbd2bhavcDeh6+9jcNaKf/d7cQaZcQcta9aId1bWhCcFbsaN6/7o6/a/a/7Q9ka68jan8Y6991aE5y5q9U5ofUaO9Yaia888816daB8Tdv9c8O8d7Q647Qa/3+5U9taOa/bs648P7QeK8E9ya/5XeKa/6Aa/8E8E7Qas8B5i7Q8E8E9ygL*028A=bS*04gK==bh*02=6+*02d2==cQ*03a/cQ=d1*02=b4ai=9k*04dp==8Y*02=5y*029+==9Y*03a/9Y=aB*02=a5=*0fcWd2an=*0jehaE=*085yfAaB=*03a3=*047XaK8oaK5o=*05cXd7aF=*05hdeG=*0haI6d=*0m5x!*0ec4!!93!*0cfqcogpcN!*0afucD!*03aN8d!*08649R!5UnPlfiAk1g8aOmriygc=*0f!=*05!!=*07!*02nPlfiA==!!=*0z!!==!*05=*0d!*025q!*0w8Y!*1w4d4d!*087Q7Q!7Q!*067Q!*057Q*05!*0f87!*0u=!*047Q7QbS5LdNgM9s!eq!eDf05mbSbRaibzbhaNehcT6+cNbNf/d7b/cQe4aZ!aEaIbsegcFfPdH==aD8oal5m9haDag8X9Y8o7eala05m9T8gau8N7O9Yaka781au7B9hcT8Td8cJ=*04!*0MbhbhdQaibta96+6+9jhAiJeEcvepboe5bSbIbRaicxbhhFaBepepcvd3f/ehcQe4aZbbaIboegcFe5d0k9k9dwhgbubqitco9k9N9H7O9D8YdX8sbdbda0ahczb69YaXai8j8y8OdH9ca+arftfwaFej9h8yeF9/=8Yau=8L815y5y5qdOeAaE=*02aX!!bu9h!*05hFdX!*05cQ9Ydja6!*0c00*06!!bu9h!!aa7Mai7O!!iIeGaB8sdmaCe6bt!!exboeJbsgjcu!*03bb8j!!bs8Tbs8Tde9C!!dsaNd0ard0aE!*036+==!*0c=*03gKdp==c48Y!!=*03!!=*05cQ9Y!*03=*07!!iseO!*05=*2p!*05=*0Vfqcofqcofqcofqcofqco=*03fucDfucDfucDfucDfucD=*07!*0g00*04!5X!a/ewew!a/4d*0387*02!7y7y6S!*02eK!*0200*04!kt!518l!*046c6c!ap!a/!*041v!*0q00*04!00*098E!*028E*05!*049d8E*09!*0oaOaO!!lc!*02anbb!*06a9!*03ct!*0l00*0w!*0hhL!dL!*02h3!*0853!!j/eK!*07jz!eP!*02dJ!*02==!!a9!*0zgLgL!*05gL*03!6+dYkViUbWiUpSwQjCcFjCqAaKbbd2f/5yb3gBeJ8TeojWpreJ9ceJkf5o8janfU!*21a7!*02bE!*07eB!bpa/!!1v!*025ibd!*02cv!*0b9Q!*0ra/!*0m=!*02a/a/!*1u5i!*0V",
|
||||
italic: "3N5b6sa39ycNb63n5T5T7oa34e5S4e7l9C6K8L8E8R8g8S7N9k8S6060a3*027vexavaea2bJad9nblcL6686aS9sevb/bq9ybqa+8N9HbQarfgb69D9q5T7l5Ta3a37Q8Z8G768/7o598Z8P4F4z8g4tdL9e8p928H7d6L5r8/8qcS7R8M6Y6K5T6Ka33N5b8H9K8X9D5T7Q7QeK7Q95a35SeK9k6za37Q*028T7Q4n7Q*0295gq*027v=av*04fb==ad*02=66*02bJ=bE*02=bEa3bE=bQ*02=9C8u=8Z*04bY==7o*02=4F*028y==8p*03a38p=8/*02=8F=*0faLbJ8/=*0jcL8P=*084FdK90=*038I=*04669s6B9s4t=*059Rb/92=*05fCcV=*0h9H5r=*0m4C!*0eaO!!87!*0ccNatfCbv!*0adjat!*039q6Y!*085T9s!5bl7iFfXhxd/90k5gydN=*0f!=*05!!=*07!*02l7iFfX==!!=*0z!!==!*05=*0d!*024z!*0w7o!*1w3333!*087Q7Q!7Q!*0d7Q7Q8Z7Q*02!*0f62!*0u=!*047Q7QaA60cuf08l!dh!cxdS4pavae97asad9qcLbq66aSayevb/aRbqcE9y!9s9H9Db/b6dHcb==9m7f924p8q9m8S7Z8r7f6h928D4p8I7E907R6S8p9s8P6V8V718qb47Wbwbm=*04!*0Madadch97ah8N666686fRgHd8aTcOahcGavafae97biadfo9xcOcOaTbQevcLbqcE9ya29Hahb/b6cEbJh0h0bXfaa2aigGaV8Z8p837b8k7od+7q8/8/8s8RbA9c8p9e9276dL8MbA7R8/8Ldpdp8pbx7C7Ccn8z=7o8D=7E6L4F4F4zbWcf8P=*028/!!a17N!*05focj!*05bq8pbA8t!*0c00*06!!a17N!!906L977b!!g/d+9x7qck8rcD9L!!cN9TcY9ceFaN!*03a276!!9D7N9D7Nbr7R!!ck8LbJ8LbJ8P!*0366==!*0c=*03fbbY==aO7o!!=*03!!=*05bq8p!*03=*07!!g8cg!*05=*2p!*05=*0VcNatcNatcNatcNatcNat=*03djatdjatdjatdjatdjat=*07!*0g00*04!5S!a3dpdp!a333*0362*02!7o7o69!*02cD!*0200*04!jc!5185!*046v6v!90!9k!*042g!*0q00*04!00*097Q!*027Q*05!*047Q*0a!*0o9n9K!!iR!*028/a2!*068N!*03a+!*0l00*0w!*0hgC!cN!*02fX!*0853!!j5eK!*07f1!eK!*02=!*02==!!9E!*0zgqgq!*05gq*03!66cbihgwargwmCsHhcb6hcni9sa2bJev4F9jdYcu8qd3hJmmcu7Rcuh84t768/dL!*2190!*02as!*07d2!b1a3!!2g!*024nat!*02bd!*0b7Q!*0ra3!*0m=!*02a3a3!*1u4n!*0V",
|
||||
boldItalic:
|
||||
"3+5U7+a/a1dLcv4d6/6/7ya/585X587oaZ7G9O9Na99na88SaAa85L5La/*028Af7bSbTbbd2bhavcDeh739jcNaKg9c+cQb2cQctadaId1bWhCcybsaN6/7o6/a/a/7Qaka98oan8J5Za9az5K5Ja15yfGaO9Yanaa8m856xaJ9AeC97at857Q647Qa/3+5U9taOa/bs648P7QeK8E9ya/5XeKa/6Aa/8E8E7QaB9K5i7Q8E8E9ygL*028A=bS*04gP==bh*026+*02=d2==cQ*03a/cQ=d1*02=b4ag=ak*04do==8J*02=5K*029Z==9Y*03a/9Y=aJ*02=a7=*0fcWd2an=*0jehaz=*085KfAaG=*03ag=*0480aK8yaK5y=*05d0c+aC=*05hheB=*0ba9=*04aI6x=*0m5F!*0ec4!!93!*0ce+cggpcN!*0afDcJ!*03aN85!*08649R!5UnPl7isk1gqbfmhiGgv=*0f!=*05!!=*07!*02nPl7is==!!=*0z!!==!*05=*0d!*025J!*0w8J!*1w4d4d!*087Q7Q!7Q!*067Q!*057Q*05!*0f87!*0u=!*047Q7QbS5LdNgM9x!eq!eDf05qbSbTafbEbhaNehcT73cNbNg9c+b/cQe4b2!aEaIbsegcyfPdJ==aD8oaq5q9saDai8X9Y8o7eaqa05qaf8gau8N7O9Yaka681au7B9sc/8TdpcA=*04!*0MbhbhdQafbrad73739jhoixeEcrepb9e5bSbEbTafcxbhhEaJepepcrd1g9ehcQe4b2bbaIb9egcye5d0k4k4dohjbmbqivczak9P9n899J8Jh38saJaJa7a7dHaM9YaOan8ofGatdS97aJagfmfmaset9D8rena2=8Jan=8o855K5K5Je0eGaz=*02aJ!!bu9h!*05hFdX!*05cQ9Ydja6!*0c00*06!!bu9h!!a57+af89!!i/h3aJ8sdHa7dWbK!!etbPeAaMgjcu!*03bb8o!!bs8Tbs8TcR97!!dsagd0agd0az!*0373==!*0c=*03gPdo==c48J!!=*03!!=*05cQ9Y!*03=*07!!ipfk!*05=*2p!*05=*0Ve+cge+cge+cge+cge+cg=*03fDcJfDcJfDcJfDcJfDcJ=*07!*0g00*04!5X!a/ewew!a/4d*0387*02!7y7y6S!*02eK!*0200*04!kB!518l!*046c6c!ap!a/!*041v!*0q00*04!00*098E!*028E*05!*048E*0a!*0oaOaO!!lc!*02anbb!*06a9!*03ct!*0l00*0w!*0hhL!dL!*02h3!*0853!!lVeK!*07hF!eP!*02=!*02==!!a9!*0zgLgL!*05gL*03!73e5l8iZbWiZq0x2jBcyjBqEaKbbd2g95Kbrh9eR9Afil0qJeR97eRkz5y8oanfG!*21a7!*02bE!*07eB!bpa/!!1v!*025ia/!*02cv!*0b9Q!*0ra/!*0m=!*02a/a/!*1u5i!*0V",
|
||||
},
|
||||
{
|
||||
name: "Verdana",
|
||||
lineHeight: 1215.33203125,
|
||||
descent: 209.9609375,
|
||||
regular:
|
||||
"5w6a7bcO9YgQbn4d76769YcO5I765I769Y*097676cO*028xfEaIaKaWc39U8/c7bL6B77aR8JdbbIcj9rcjaTaI9EbsaIftaJ9DaJ76*02cO9Y9Y9p9L899L9k5w9L9V4i5o9g4ifd9V9v9L9L6H896a9V9gcO9g9g8d9X769XcO5w6a9Y*03769Y9YfE8xa5cO76fE9Y8ucO8u8u9Ya29Y5I9Y8u8xa5fE*028x=aI*04fo==9U*02=6B*02c7==cj*03cOcj=bs*02=9t9I=9p*04eX==9k*02=4i*029A==9v*03cO9v=9V*02=9L=*0fa7c79L=*0jbL9V=*084idD9C=*039g=*044E8J7a8O4s=*05bqbI9V=*05gKfl=*0h9E6a=*049S=*049S=*0a4I!*0ebP!!9Y!*0ccD=!*0cbQak!*18=*05!*0n=*03!*0Y9k!*1H9Y9Y!9Y!*0d9Y*05!*0L=!*049Y9YaI76bLdC8s!dN!bNec4iaIaK8Sa/9UaJbLcj6BaRaKdbbIa9cjbL9r!aw9E9DcPaJdDcO==9L819V4i9T9L9I9g9w817a9V9M4i9g9ga09g7T9v9Z9N7Y9S7M9Tcm9ecScJ=*04!*0N9Uco8SaZaI6B6B77huhfcOaRbK9DbLaIaKaK8SbG9Ufd9EbKbKaRbudbbLcjbL9raW9E9DcPaJbVb8g6glcfeoaFaZgab29p9C9j7n9K9kcu8ca0a09g9JaU9Z9v9Z9L8m7M9gd99ga59tdIdUa1cq8X8zd79o!=9V=8z894i4i5oeiei9V=*029Z!*0niAgg!!fncJ!*0400*06!*058S7n8S7n!!fdcu!!aR9gaR9g!*03bL9Z!*03cj9F!*039D9g9D9gaJ9g!*03b89tb89VdKaNdKaN!*0nbP9k!*0dcj9v!*2l=*05!*0naC!=*0VcD=cD=cD=cD=cD=*04bQakbQakbQakbQakbQak=*07!*0g00*04!769Y9YfEfE!9Y4d*037b*039Y9Y8x!*02cO!*0200*042MnN!5F8J8J!*037676!9N!9Y!*045F!*0q00*04!00*09!*038u8u!8u8u!*058x!*0v9YaWaW9Y9YfdbIicifftd39L9YaR9EfE899rc7aIaIaW!*0p00*0w!*0jgQ!*0c53!!ik!*08hE!fh!*02=!*06be!*0HfE*03!*2y9Y!*02bn!*07cO!bncO!!5F!*025IcO!*02fE!*0b9Y!*0rcO!*0m=cO!!cOcO!*2p",
|
||||
bold: "5m6i9bdzb7jUdu5c8v8vb7dz5F7w5FaNb7*096i6idz*029Ff4c8bWbkc+aHaacHd58y8Hc39ZeQdfdibtdiceb6aGcIbYhEbYbxaQ8vaN8vdzb7b7asaX9caXao6CaXb85m6jav5mgyb8aLaXaX7N9h78b8aafjatab9lb78vb7dz5m6ib7*038vb7b7f49mdidz7wf4b79bdz9m9mb7bhb75Fb79m9mdiiu*029F=c8*04h6==aH*02=8y*02c+==di*03dzdi=cI*02=bvb9=as*04fW==ao*02=5m*02aD==aL*03dzaL=b8*02=aX=*0fdMc+aX=*0jd5b8=*085mfLbo=*03av=*048a9Z8Ja25w=*05cVdfb8=*05hLgI=*0g7haG78=*0m5p!*0ecB!!b7!*0cei=!*0cdebC!*18=*05!*0n=*03!*0Yao!*1Hb7b7!b7!*0db7*05!*0L=!*04b7b7ct6idgfFb1!f8!eHfa5mc8bW9ZcCaHaQd5di8yc3c8eQdfbbdid5bt!aIaGbxeUbYfgdc==aX99b85mb2aXbcabaL998Bb8aY5mavabbhaa95aLbgaX8Obm8nb2ej9XeJd+=*04!*0NaHef9ZbCb68y8y8Hj6i+eEc3debxd5c8bSbW9Zd9aHhrb3dedec3ddeQd5did5btbkaGbxeUbYdicjicipebgDbSbCiHcrasaVaB8jaPaofD9cbgbgavb5c+bgaLbgaX9m8nabf6atbpaIfGfRbDeFa99ufyaG!=b8=9t9h5m5m6jfQfYb8=*02bg!*0nl8jc!!gme2!*0400*06!*059Z8j9Z8j!!hrfD!!c3avc3av!*03d5bg!*03dDaL!*03bxabbxabbYat!*03cjaIcjb8fTckfTck!*0ncBao!*0ddiaL!*2l=*05!*0nbI!=*0Vei=ei=ei=ei=ei=*04debCdebCdebCdebCdebC=*07!*0g00*04!7wb7b7fEfE!b75c*039b*03b7*02!*02gp!*0200*042HrN!5x9E9E!*038v8v!a/!b7!*046T!*0q00*04!00*09!*039m9m!9m9m!*059m!*0vb7bkbkb7b7gydfk/kYhEejaXb7c3aGhBavbtcHc8b6bk!*0p00*0w!*0jjU!*0c6u!!ke!*08kY!f4!*02=!*06bI!*0Hiu*03!*2yb7!*02cC!*07dB!aWdz!!6T!*025Fdz!*02gz!*0b8q!*0rdz!*0m=dz!!dzdz!*2p",
|
||||
italic: "5w6a7bcO9YgQbn4d76769YcO5I765I769Y*097676cO*028xfEaHaKaWb+9U8/c7bL6B77aR8JdbbIcj9rcjaTaI9EbsaHfuaJ9DaJ76*02cO9Y9Y9p9L899L9k5w9K9V4i5o9b4ifd9V9v9L9L6H896a9V9fcO9g9f8d9X769XcO5w6a9Y*03769Y9YfE8xa5cO76fE9Y8ucO8u8u9Ya29Y5I9Y8u8xa5fE*028x=aH*04ft==9U*02=6B*02b+==cj*03cOcj=bs*02=9t9I=9p*04eX==9k*02=4i*029A==9v*03cO9v=9V*02=9L=*0fa7b+9L=*0jbL9V=*084idD9C=*039b=*044E8J7a8J4i=*05bqbI9V=*05gKfk=*0h9E6a=*049S=*0g4I!*0ebQ!!9Y!*0ccD=!*0cbQak!*18=*05!*0n=*03!*0Y9k!*1H9Y9Y!9Y!*0d9Y*05!*0L=!*049Y9YaI76bLdC8s!dN!bNec4iaHaK8Sbm9UaJbLcj6BaRaKdbbIa9cjbL9r!aw9E9DcLaJdDcO==9L819V4i9S9L9I9f9w817a9V9M4i9g9g9/9f7T9v9Z9M7Y9S7M9Scm9ecScJ=*04!*0N9Uco8SaZaI6B6B77huhfcOaRbK9DbLaHaKaK8SbG9Ufd9EbKbKaRbudbbLcjbL9raW9E9DcLaJbVb8g6glckeoaFaZgab29p9C9j7n9K9kcu8ca0a09g9JaU9Z9v9Z9L8j7M9fd99ga59tdIdUa1cq8X8zd79o!=9V=8z894i4i5oeiei9V=*029Z!*0niAgg!!fncJ!*0400*06!*058S7n8S7n!!fdcu!!aR9gaR9g!*03bL9Z!*03cj9F!*039D9f9D9faJ9g!*03b89tb89VdKaNdKaN!*0nbQ9k!*0dcj9v!*2l=*05!*0naC!=*0VcD=cD=cD=cD=cD=*04bQakbQakbQakbQakbQak=*07!*0g00*04!769Y9YfEfE!9Y4d*037b*039Y9Y8x!*02cO!*0200*042MnL!5F8J8J!*037676!9N!9Y!*045F!*0q00*04!00*09!*038u8u!8u8u!*058x!*0v9YaWaW9Y9YfdbIicidfud39L9YaR9EfE899rc7aIaIaW!*0p00*0w!*0jgQ!*0c53!!ik!*08gh!fh!*02=!*06be!*0HfE*03!*2y9Y!*02bm!*07cO!bncO!!5F!*025IcO!*02fE!*0b9Y!*0rcO!*0m=cO!!cOcO!*2p",
|
||||
boldItalic:
|
||||
"5m6i9bdzb7jUdu5c8v8vb7dz5F7w5FaNb7*096i6idz*029Ff4c8bWbkc+aHaacHd58y8Hc39ZeQdfdibtdiceb6aGcIbYhEbYbxaQ8vaN8vdzb7b7asaX9caXao6CaXb85m6jav5mgyb8aKaXaX7N9h78b8a9fjatab9lb78vb7dz5m6ib7*038vb7b7f49mdidz7wf4b79bdz9m9mb7bhb75Fb79m9mdiiu*029F=c8*04h6==aH*02=8y*02c+==di*03dzdi=cI*02=bvb9=as*04fW==ao*02=5m*02aD==aK*03dzaK=b8*02=aX=*0fdMc+aX=*0jd5b8=*085mfLbo=*03av=*048a9Z8J9Z5w=*05cVdfb8=*05hLgI=*0g7haG78=*0m5p!*0ecD!!b7!*0cei=!*0cdebC!*18=*05!*0n=*03!*0Yao!*1Hb7b7!b7!*0db7*05!*0L=!*04b7b7ct6idgfFb1!f8!eHfa5mc8bW9ZcCaHaQd5di8yc3c8eQdfbbdid5bt!aIaGbxeUbYfgdc==aX99b85mb2aXbcabaL998Bb8aY5mavabbfa995aKbgaX8Obm8nb2ej9XeJd+=*04!*0NaHef9ZbCb68y8y8Hj6i+eEc3dhbxd5c8bSbW9Zd9aHhrb3dhdhc3ddeQd5did5btbkaGbxeUbYdicjicipebgDbSbCiHcrasaVaB8jaPaofD9cbjbjavb5c+bgaKbgaX9c8nabf6atbpaIfGfRbDeFa99wfyaG!=b8=9u9h5m5m6jfQfYb8=*02bg!*0nl3jc!!gme2!*0400*06!*059Z8j9Z8j!!hrfD!!c3avc3av!*03d5bg!*03doaC!*03bxabbxabbYat!*03cjaIcjb8fTckfTck!*0ncDao!*0ddiaK!*2l=*05!*0nbI!=*0Vei=ei=ei=ei=ei=*04debCdebCdebCdebCdebC=*07!*0g00*04!7wb7b7fEfE!b75c*039b*03b7*02!*02gp!*0200*042HrN!5x9E9E!*038v8v!a/!b7!*0451!*0q00*04!00*09!*039m9m!9m9m!*059m!*0vb7bkbkb7b7gydfk/kThEejaXb7c3aGhBavbtcHc8b6bk!*0p00*0w!*0jjU!*0c6u!!ke!*08jU!f4!*02=!*06bI!*0Hiu*03!*2yb7!*02cC!*07dB!aWdz!!51!*025Fdz!*02gz!*0b8q!*0rdz!*0m=dz!!dzdz!*2p",
|
||||
},
|
||||
{
|
||||
name: "Tahoma",
|
||||
lineHeight: 1207.03125,
|
||||
descent: 206.54296875,
|
||||
regular:
|
||||
"4V5c6hbo8yfhay3j5/5/8ybo4L5H4L5+8y*095y5ybo*027qed9o9d9paC8N89araz5R6x9c7Oc3arb48Db49J8J98ag9le695908L5/5+5/bo8y8y8d8F7d8F8e4+8F8K3B4q7O3Bd88K8v8F8F5E6+5e8K7ObC7L7O6Y7w5+7wbo4V5c8y*035+8y8yex7J8Zbo5Hex8y7nbo7J7J8y8U8y5y8y7J7J8ZfE*027q=9o*04eh==8N*02=5R*02aW==b4*03bob4=ag*02=8R8A=8d*04dM==8e*02=3B*028y==8v*03bo8v=8K*02=8F=*0faLaW8Z=*0jbb92=*083Bbr84=*037O7O=*035F7O6Z864i=*05aQar8K=*05fhed=*0g7k985j=*0m3+8FaB9d8F978F9p9p7daWb+9d8F8v8Nb48l898yar9ld/3B5R9c7O4i7Odvar8Kb4bL8PegaO9/8F8R8J6+8I8y5e985e98bf9ua+agaR7O8L6Y8l8l6Y6Y8y8y7a7z8F5+5+bo5cjrhEflf3cR7CgCencR=*0f8e=*05ar8F=*086Y=jrhEfl==fF8M=*0z7R6M==9YbL968m8L6Y=*0d6FbU6J4qdNdN9o9p7d7O986+6Y8t7d9dag9l8N8e6x4qbk8H9J5E907O8d8H8H8F7d7d8F8F8e8ebf777a9Y8j4+8F8F8q7O9x8K*023B3B5R664i3B8Gd8*028K8K8P8vcibl8v5E*045t5t82826+8y4+8y935e5e8K9U8J7ObC7O766Y8B6Y6Y7d*03b48c8j8q8P6f7O6v8F7d7ddPdGfsam8xbvcE9Q8I7B8Parc561613E3Y*025u7D5k4C7r3j*028y8y5U5Ubo*038y*095y5y8y8y5d*028y*065d5+5g2v5G5f5U5/*045d5d8y8y6h8y*085y8y*055d838m9s7v8y8yauar!!8y7d*02=6x!*038y8y9o=aCco7B!cw!becw3B9o9d7X9H8N8Lazb45R9c9lc3ar8Sb4az8D!8I9890bJ95cpa+==8H778K3B8J8H8H7O8v77678K8H3B7O7O8U7O6N8v8P8E6K967j8Jb27Nbabl=*049c8H8JaycQ=8vbl8wb48v9p7d89789N8hbQ91dvd89Y8K9Y8q8J8J9x9xb48C7o6u8w8C7d4qb47d7d8R8F9pc39/8E9p*028N8Nbe7X9o8J5R5R6xfFfobe9rau8/az9o9d9d7XaI8Nd+8lauau9raCc3azb4az8D9p988/bJ95aJ9YeLe+aNcl979oeT9z8d8C8c6v8K8ebq7a8P8P7O8H9/8P8v8P8F7d7j7ObU7L8Y8vcacm8UaR7Q7nbW8g=8e92=7n6+3B3B4qcWcU92=*028PhUbpaF8WdjaP9o7OcPaRci9CfUd28l7acpbab48vbd9G==h/fmdnaleEbShUbp9p7d7M00*06au8P977Q8D8F7Y6v7X6v8W7+evbL8l7a9W8b9r7O9r7Obe8WaO8/cn9YfEdgbz8U9p7d987j907O907O9B83cIad9Y8v9Y8v9Y8KcV9ScV9S5R==9r7OaC8Haz8Paz8P9Y8vc39/3B=*03ehdM==b48e=*058l6Y=*05b48v=*0b7X6v==7X6v9H7A957L=*0R7O=*1y8d=4+4+a28v=*0VbL8PbL8PbL8PbL8PbL8P=*03bf9ubf9ubf9ubf9ubf9u=*07dD798P8v8/8f7QfE8yed4L3z2n8y4L381j00*045H5H8y8yeded5+8y3j*036h6h6d6h8y8y77774g8xcN4LfEfE00*042slLsb4C7r7r4C7r7r6I5/5/fE8L7q8ycqcq6Igj5H6N5/5/enc7bK8y8y7M7M8y4mcq8ybobocq8y9I9Scece5xhUce5x4L3u00*04!00*097J00!!7J*0841417J*0d4141!5W6a6k5c6a615w2v8+616a5G4C!*02919p9p8y8yd8areWhPe6d38Z8y9c98fE898D8y*038a9R8y*02c+cw8ybk9d!*0f00*0w!*0efhfh9pgm9ufhfI8l9oeI9Dhd9Vaz8K8Ka17u8753cwarhRexbB8Db4eyc09JarbAdkfpdI9l8L6Y=a+9f3B==e89N9V8k8kck89hc8rcdbK8Ab05lfkeW8P7O7Xaz9Yar7O7O90aC8F8e3B4qalaycYbB7dhLfEfEkxfEgBfE*098k5Rb0gbfh9lfhkspDeO95eVk47O9paCc33B5+8nb67Ob6dwfVb27Lb2dr3B7d8Fd8hoaCho9p7d9p9nbihofB8y8y!*03fE7QfE7QfE7Q!*0h7Q!*1o8y!*029H!*07aE!9Ybo!!2r!*024Lbo!*02edfj!*08bf!8y!*095y!*0gbo!*0m=bo!!bobo!*2p",
|
||||
bold: "4B5n7FcO9ZiLcd4j76769ZcO4V6L4V919Z*095H5HcO*028SeoaJaKarbR9D95bFbY7z7QaU8YdZc3c2ahc2bm9V9Abzazg4aJau9L769176cO9Z8y9n9U8f9R9i5+9Ra04K5H9r4KeWa09F9R9R6O836wa093dW9s908e9L9Z9LcO4B5n9Z*058yex7Ya/cO6Lex9Z88cO8r8r8yab9Z5H8y8r8ra/hE*028S=aJ*04ft==9D*02=7z*02c6==c2*03cOc2=bz*02=aja6=9n*04eF==9i*02=4K*029I==9F*03cO9F=a0*02=9R=*0fcNc69N=*0jce9X=*084KeIa8=*039r=*047G8Y7D9d5f=*05bCc3a0=*05gdfp=*0g9H9A6w=*0m529UccaK9UaB9Uarar8fc6dkaK9R9F9Dc29Y959ZbFazfm4K7zaU9r4K90fic39/c2d99PgNd4bL9Rbm9V839z9Z6w9A6w9Ackb9c2bzcobs9L8e9Z9Z8e8e9Z9Z8c8I9R9Z9ZcO5nlbjGhoh8f4a0jshefn=*0f9i=*05bF9R=*088e=lbjGho==h4ag=*0z918e==bId5axax9L8e=*0d7+dl885He/e/aJar8f8Y9A838e9e8faKbzaz9D9i7Q5Hcj9Rbm6Oau909n9R9R9U8f8f9R9R9i9icY8b8cbF9V5+9R9R8Q93a6a0*024K4K74716v4KareW*02a0a0a99FcHcGck6O*046j6j9X9X839Z5+8Lav6w6wa0as9X93dW928H8eaV8e8e8f*03c29w9V8Qa97o9r7J9R8f8fgrfIj5d1bqeheWcjbi8o8Pc9dQ6V6V4p4J*026U9k6d4V8u4j*028y8y6E6EcO*038y*095H5H8y8y5d*028y*06675+6f3k6s6x6E5/*045d5d8y8y7F8y*085H8y*055d7/8j9A9A8y8yc7bP!!8y8f*02=7Q!*038y8ybp=cjeEam!e0!dJe64KaJaK8Rb09D9LbYc27zaUazdZc39Uc2bYah!9z9AaudJaJe6c2==9R8b9/4K9X9Ra1939F8b7y9/9T4K9o92ab93819Fa69R7Uag899Xd48PdmcG=*04aUa19XcFff=ckcGbbc29Far7U9595bq8Gcp9sfieWbfa0bf9J9V9Va6b9c29E9h7Cbb9Q8f5Hc28j8jaj9RardZbR9Rar*029D9DcD8Rar9V7z7z7QhohccSaYc7atb+aJaKaK8Rb/9Dgk9Yc7c7aYc8dZbYc2bYahar9AatdJaJc8bfh1hfcCf0aBarhDbc9n9Q9w7Pa79idS8cacac9raebRa99Fa69R8f8990dU9sag9EereCaBdd8/8jer9x=9i9X=8j834K4K5Heqej9X=*02a8iAdRcyakfWd2az93fmdph3dRlLi79Y8ce6dmc29FcRba==kRiCdzaqfPdoiAdRar8f9100*06c7acaB8/ah9R8R7P8R7PaI91gwdV9Y8cb99zaY9raY9rddb8caakedbThreqd6acar8f9A89au90au90a/9NdCbabf9Ebf9Ebfa0e9bBe9bB7z==aY9oc8aebYa9bYa9bf9EdZbR4K=*03fteF==c29i=*059Z8e=*05c29F=*0b8R7P==8R7Pcyb4aJ9s=*2p9n=5+5+b29u=*0Vd99Pd99Pd99Pd99Pd99P=*03ckb9ckb9ckb9ckb9ckb9=*07gw9Had9Hbhae7QfE9Zed4K3z2n9Z4V381j00*046L6L9Z9Zeded9Z9Z4j*037F*039Z*035darfE4VfEfE00*042sqcxH4V8u8u4V8u8u6G6F6FfE9/9C9ZcJcJ6GiP6L6N7676h8d+dI9Z*045HcJ9ZcOcOcJ9Z8Tbqbzbz5HhJbX5H4V3u00*04!00*098r00!!8r*084L4L8r*0d4L4L!6L6X796l6X6V6w3kab6V706s5q!*02a6arar9Z9ZeWc3jmkRg4ej9N9ZaU9AhBavah9Z*03aDa19Z*02deev9ZbHaK!*0f00*0w!*0eiLiLari4bhiLjc9YargzaUiJcnbYa0a09O8U9553eCc3jhexdUahc2fGeWbmbmdbdtePdtaz9L8e=c2aO4K==fgbXaI9u9Qcx95jQ9DdZcM9Tc25lfAfAa6938RbYb5bF8Y8YaubR9R9i4K5HcicdgCdr83k1hEhEjNhEjNhE*099O7zeslkihazihp9w2ipaJipph8YarbRdZ4K8jbVdw93dBhakMdY9se0hC4K8f9ReWiucJk9ar8farbacJkthE9Z9Z!*03fE7QfE7QfE7Q!*0h7Q!*1o9Z!*02b0!*07ci!b5cO!!2W!*024VcO!*02fEfj!*08bf!9Z!*095H!*0gcO!*0m=cO!!cOcO!*2p",
|
||||
},
|
||||
{
|
||||
name: "Century Gothic",
|
||||
lineHeight: 1226.07421875,
|
||||
descent: 220.21484375,
|
||||
regular:
|
||||
"4l4D4Rbg8Gc7bR365N5N6F9u4l5c4l6R8G*094l4l9u*029fdzbA8+cJbE8o7BdEaH3y7y9f7eenbAdB9gdD9v7O6Gafa+f09x9g7w5v9t5vaw7Q5WaHaGa7aJaa4Wax9y383b7S38eG9yafaGaG4J645j9w8Gc/7w8o6F5vaw5v9u4l4D8G*03aw9D5NbH5N6F9u5cbH7Q6g8B5c5o5T908Q5d545c5N6Fc/*029f=bA*04fw==8o*02=3y*02cm==dB*039udA=af*02=9g8G=aH*04i5==aa*02=38*02af==af*038Bad=9w*02=aG=*0gcmaJ=*0jaH9y=*0838b46j=*037S=*043e7e48854I=*059Ac99y=*05iGhN=*0h6G5j=*0m38!*0h8G!*1C=*05!*357S7S!7B!*0d753u5c4K6T8E!*0L=!*045W5WbA4l94bn4e!dB!a6d438bA8+7ebA8o7waHdB3y9fa+enbA8jdBaH9g!7R6G9gdr9xcnd4==aH6D9y389jaH9k8G8Y6D7h9yaf387S8o9y8G7hafauau93bd6i9jb+7wbwdp=*04!*0N8oav7ecJ7O3y3y7ygFgjaD9f!a6a9bA8Z8+7ebI8oeD95bAbA9fa+enaHdBaH9gcJ6Ga6dD9xb48rfMgGaIcp9ucJh798aHat7k5F9taac16D9E9E7S8GdL9maf9maGa75/8ogW7wad7aeOfF87av7na2d46Z!a99P=a26438383bcode9P=!=9n!*0y00*06!*056l5A!*3J=*05!*1H==!*0m00*04!5c!7QfEbK!7Q5v5v5y5v7S7A7S!8F8F9u!*02fE!*0200*04!im!364R!*043X3X!8j!8G!*042C!*0q00*04!00*09!*0e5A!*0y7B8G!!gX!*038G!*0y00*0w!*0jdD!*0c5C!!ha!*0afE!*02c0!*069o!*0Hc/*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2C!*024l8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
bold: "4o4o5E9o8MdsaE3s5Y5Y6U9o4o6A4o7c8M*094o4o9o*028MbAbA94ccaY887wd8aE4o7w9I6Ue4bAd88Md894886Aa0aYe4aE9I7Q50a0509o7Q6Aakaka0aka04oak9o3M44943MeI9oa0akak506U4I9o8Mcw8M947c5k9o5k9o4o4o8M8M9o8M9o8M7QbA5E7c9o6AbA7Q6g8B5g5g6A909o5d5k5g5E7cd8*028M=bA*04e4==88*02=4o*02bC==d8*039od8=a0*02=8M9o=ak*04gU=a0*03=3M*02a0==a0*038Bak=9o*02=ak=*0fbhbCak=*0jaE9o=*083MbU7Q=*0394=*044X6U5r7w50=*05a3co9o=*05gAgU=*0g5D6A4I=*0m3M!*0h8M!*1C=*05!*358s8s!6A!*0d7w4o5E5k7waY!*0L=!*046A6AbA4o9obU5D!dH!b1dX3MbA947fbA887QaEd84o9IaSe4bA8hd8aE8M!7R6A9IdraEcRdn==ak6S9o3M9oak9H8M9o6S7s9oaf3M94949o8M7sa0azac99bd6w9oct8MbWdp=*04!*0N88aO7fcc884o4o7wfxeQaJ9G!a1aEbA8V947fc388eD8maLaL9IaSe4aEd8aE8Mcc6Aa1bOaEbK9Ef5g0addf8Ucchb9bakac8n6gaba0cC729o9o8p8xcf9oa09oaka08n94fM8May8Ie5ff95c07+9Mdx89!=9o=9M6U3M3M44ccdc9o=!=9o!*0y00*06!*057w6K!*3J=*05!*1H==!*0m00*04!6A!7QfEbK!7Q4o*037w*02!8M8M9o!*02fE!*0200*04!k0!3s5E!*043M3M!8P!8M!*042w!*0q00*04!00*09!*0e5m!*0y7w8M!!i4!*038M!*0y00*0w!*0jdN!*0c7z!!hm!*0afE!*02c0!*069o!*0Hd8*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99o!!2w!*024o8B!*02b9fj!*089d!4i!*0r8B!*0m8B9o!!8B8B!*2p",
|
||||
italic: "4l4D4Rbg8Gc7bR365N5N6F9u4l5c4l6R8G*094l4l9u*029fdzbA8+cJbE8o7BdEaH3y7y9f7eenbAdB9gdD9v7O6Gafa+f09x9g7w5v9t5vaw7Q5WaHaGa7aJaa4Wax9y383b7S38eG9yafaGaG4J645j9w8Gc/7w8o6F5vaw5v9u4l4D8G*03aw9D5NbH5N6F9u5cbH7Q6g8B5c5c5T908Q5d545c5N6Fc/*029f=bA*04fw==8o*02=3y*02cm==dB*039udA=af*02=9g8G=aH*04i5==aa*02=38*02af==af*038Bad=9w*02=aG=*0faNcmaJ=*0jaH9y=*0838b46j=*037S=*043a7e48854I=*059yc99y=*05iGhN=*0h6G5j=*0m38!*0h8G!*1C=*05!*357S7S!7B!*0d753u5c4K6T8E!*0L=!*045W5WbA4l94bn4e!dB!a6d438bA8+7ebA8o7waHdB3y9fa+enbA8jdBaH9g!7R6G9gdr9xcnd4==aH6D9y389jaH9k8G8Y6D7h9yaf387S8o9y8G7hafauau93bd6i9jb+7wbwdp=*04!*0N8o9V71ch7O3y3y7yggfW9V8Z!9LabbA8C8+70bd8odL8kbmbm91bhenaHdBaI9gcJ6G9LcQ9xar8XfOgfa2cz93chh19gaHaz7k5v9eaacd6G9y9y8186df9yaf9yaGa76t8ogP7w9U7feXfp7VaX7Ca0db7l!=9y=9Z6438383bcddq9y=!=9y!*0y00*06!*056u5Z!*3J=*05!*1H==!*0m00*04!5c!7QfEbK!7Q5v5v5y5v7S7A7S!8F8F9u!*02fE!*0200*04!im!364R!*043X3X!7q!8G!*042C!*0q00*04!00*09!*0e5h!*0y7B8G!!hB!*038G!*0y00*0w!*0je6!*0c5B!!hf!*0afE!*02c0!*069o!*0Hc/*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2C!*024l8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
boldItalic:
|
||||
"4o4o5E9o8MdsaE3s5Y5Y6U9o4o6A4o7c8M*094o4o9o*028MbAbA94ccaY887wd8aE4o7w9I6Ue4bAd88Md894886Aa0aYe4aE9I7Q50a0509o7Q6Aakaka0aka04oak9o3M44943MeI9oa0akak506U4I9o8Mcw8M947c5k9o5k9o4o4o8M8M9o8M9o8M7QbA5E7c9o6AbA7Q6g8B5g5g6A909o5d5k5g5E7cd8*028M=bA*04e4==88*02=4o*02bC==d8*039od8=a0*02=8M9o=ak*04gU=a0*03=3M*02a0==a0*038Bak=9o*02=ak=*0fb3bCak=*0jaE9o=*083MbU7Q=*0394=*044x6U5n6U50=*059Ucc9o=*05gAgU=*0g5G6A4I=*0m3M!*0h8M!*1C=*05!*358s8s!6A!*0d7w4o5E5k7waY!*0L=!*046A6AbA4o9obU5D!dH!bwdX3MbA947fbA887QaEd84o9IaYe4bA8hd8aE8M!7R6A9IdraEcRdn==ak6S9o3M9oak9H8M9o6S7s9oaf3M94949o8M7sa0azac99bd6w9oct8MbWdp=*04!*0N88ar7gca884o4o7wfFeOaf9G!asaEbA8/947gcb88ey82aEaE9Ga/e4aEd8aE8Mcc6AasbvaEbl9rf9fR9Cde8SbSh29eakao8z699Ua0d47n9o9o918AcB9oa09oaka08o8MfV8Ma78IedeY8+ch7Y9udC8g!=9r=ac6U3M3M44cid59o=!=9o!*0y00*06!*057d6o!*3J=*05!*1H==!*0m00*04!6A!7QfEbK!7Q4o*037w*02!8M8M9o!*02fE!*0200*04!k0!3s5E!*043M3M!8V!8M!*042w!*0q00*04!00*09!*0e5e!*0y7w8M!!id!*038M!*0y00*0w!*0jeu!*0c7w!!hf!*0afE!*02c0!*069o!*0Hd8*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99o!!2w!*024o8B!*02b9fj!*089d!4i!*0r8B!*0m8B9o!!8B8B!*2p",
|
||||
},
|
||||
{
|
||||
name: "Consolas",
|
||||
lineHeight: 1170.8984375,
|
||||
descent: 257.32421875,
|
||||
regular:
|
||||
"8C*a+!*03=8C!*038C*04!*048C*06!8C!8C*0j!8C*0H!8C*2O00*068C*4h!!8C!=8C*1o!*058C*032T291r8C*0300*048C*0i!*028C!*0200*048C8C!8C*02!*038C8C!8C*02!*038C8C!*0o8C8C00*04!00*098C8C!!8C*0q!8C*04!*0a8C*0l!!8C*02!*0k00*0w!*0j8C!*0c8C!!8C8C!*098C!*02=!*068C!*028C!*0p8C8C!*038C*0b!*0z8C8C!*0a8C*05!*0h8C!*1o8C!*028C!*078C!8C8C!!8C!*028C8C!*028C8C!*088C!8C!*0r8C!*0m=8C!!8C8C!*2p",
|
||||
bold: "8C*a+!*03=8C!*038C*04!*048C*06!8C!8C*0j!8C*0H!8C*2O00*068C*4h!!8C!=8C*1o!*058C*032T291r8C*0300*048C*0i!*028C!*0200*048C8C!8C*02!*038C8C!8C*02!*038C8C!*0o8C8C00*04!00*098C8C!!8C*0q!8C*04!*0a8C*0l!!8C*02!*0k00*0w!*0j8C!*0c8C!!8C8C!*098C!*02=!*068C!*028C!*0p8C8C!*038C*0b!*0z8C8C!*0a8C*05!*0h8C!*1o8C!*028C!*078C!8C8C!!8C!*028C8C!*028C8C!*088C!8C!*0r8C!*0m=8C!!8C8C!*2p",
|
||||
italic: "8C*a+!*03=8C!*038C*04!*048C*06!8C!8C*0j!8C*0H!8C*2O00*068C*4h!!8C!=8C*1o!*058C*032T291r8C*0300*048C*0i!*028C!*0200*048C8C!8C*02!*038C8C!8C*02!*038C8C!*0o8C8C00*04!00*098C8C!!8C*0q!8C*04!*0a8C*0l!!8C*02!*0k00*0w!*0j8C!*0c8C!!8C8C!*098C!*02=!*068C!*028C!*0p8C8C!*038C*0b!*0z8C8C!*0a8C*05!*0h8C!*1o8C!*028C!*078C!8C8C!!8C!*028C8C!*028C8C!*088C!8C!*0r8C!*0m=8C!!8C8C!*2p",
|
||||
boldItalic:
|
||||
"8C*a+!*03=8C!*038C*04!*048C*06!8C!8C*0j!8C*0H!8C*2O00*068C*4h!!8C!=8C*1o!*058C*032T291r8C*0300*048C*0i!*028C!*0200*048C8C!8C*02!*038C8C!8C*02!*038C8C!*0o8C8C00*04!00*098C8C!!8C*0q!8C*04!*0a8C*0l!!8C*02!*0k00*0w!*0j8C!*0c8C!!8C8C!*098C!*02=!*068C!*028C!*0p8C8C!*038C*0b!*0z8C8C!*0a8C*05!*0h8C!*1o8C!*028C!*078C!8C8C!!8C!*028C8C!*028C8C!*088C!8C!*0r8C!*0m=8C!!8C8C!*2p",
|
||||
},
|
||||
{
|
||||
name: "Candara",
|
||||
lineHeight: 1220.703125,
|
||||
descent: 275.390625,
|
||||
regular:
|
||||
"3p3Y747U6Y7UaG3+5x5x7U7U3Y*024b8B5u7e7C8l7H8E7p8C8A3Y3Y7U*025xfN9E9a8Ba3897F9Jac4k6w9g7GdmayaS8FaS9t7/7ZaH8GdS8K8C875x4b5x7U7U4i7H8I748C815j8s8u3q3q7E3BcP8u8L8I8I5y6z5D8o7wb+7U7h785x3Y5x7U3p3Y7U6Y7E6Y3Y6z6oa04J767U3Ya03Q4b7U4b4b4i8Dat3Y3B4b4J76bR*025x=9E*04cK==89*02=4k*02a3==aS*037QaS=aH*02=8F8r=7H*04cj==81*02=3q*028A==8L*037U8L=8o*02=8K=*0f9Ma38H=*0jac8u=*083qaV6Q=*037E=*023O=4J7G5d7G4r=*059Say8w=*05e5du=*0g6+7Z5D=*0m4k!*0h7U!*0cbz9P!*0cc39Z!*18=*05!*0n=*03!*2F5+5+!3Q!*0d5+414G3B6M6L!*0B2K2K!*07=!*044i=a9=aQcU71!cF!bQcH3/9E9a7o9k8987acaS3F9g9kdmay8eaSaf8F!8f7Z8CaW8KaUaD4k=947b8x3/8n948q7P8B7b6R8x8/3/8x83997P6/8L9F8r6D937A8nbK7UbobN=*04!*0e8o7q8B8c!*0t89899V7z8H7/4k4k6fdhdtad9paB819W9E8W9a7za989dm8laBaB9p9CdmacaS9N8F8B7Z81aG8K9Z9wdZelatcn8V8Iev9j7H8L7P5Z8P81bc6S8h8h7E7QaH888L7V8I746U7haq7U8m7nbJct8Sa17k7kbH7S=818t=7e6z3q*02b2bn89=*027R!!ae8H!*0daS8L8/7C!*0c00*06!*057w5Z!*3J=*05!*0p=*0Vbz9Pbz9Pbz9Pbz9Pbz9P=*03c39Zc39Zc39Zc39Zc39Z=*07!*0g00*043Y3Y!7QfEfE!!3Y*02!7U*02!5x5xak!*02fE!*0200*04!bR!*073Y3Y!!5x!*052i!*0q00*04!00*094b!*024b*0a4A4b*0e!*0r8H6Y!*0y00*0w!*0x5H!!fNa0!*09ap!*02ar!*06cM!*3i8E!*029V!*07b9!b97U!!2i!*023Y7U!*02bQ!*0b7U!*0r7U!*0m=!*027U7U!*2p",
|
||||
bold: "3p3Y797U6Y7UaG3Y5x5x7U7U3Y*024b8m5e7v7n8p7p8h7h8o8g3Y3Y7U*025xfN9S9m8Ea58f7H9Kad4n6f9d7BdwapaV8IaV9k8b8eai8+el9b8E835x4b5x7U7U4i7H8H6Z8C805G8D8C3V3V7+42d08C8L8M8H616z5H8t7Fck837F6P5x3Y5x7U3p3Y7U6Y7E6Y3Q6z6oal4o767U3Yal3Q4b7U4b4b4i8Dat3Y3B4b4T76bR*025x=9S*04cY==8f*02=4n*02a5==aV*037QaV=ai*02=8I8v=7H*04cj==80*02=3V*028E==8L*037U8L=8t*02=8H=*0fafa58H=*0jad8C=*083VaC7O65=*027+=*045A7B5Y7B4V=*05b2ap8C=*05eedu94=94=94=80=80=*0280=*037h8e5H=*0m4p!*0h7U!*0cc6am!*0cczaJ!*18=*05!*0n80=*02!*2F5+5+!3Q!*0d5+414G3B6M6L!*0B3939!*07=!*044i=av=aXc+73!cH!bRcU3/9S9m7A9y8f83adaV4n9d9ydwap8faVa28I!8l8e8Eb09bbfb1==947b8x3/8n948q7P8B7b6R8x8/3/8x83997P6/8L9F8r6e937A8nbK7UbobN=*04!*0e8H7q8B8B!*0t8f8fa27D8H8b4n4n6fdodEar9kaC8l9X9S9a9m7Dao8fdl8uaCaC9k9BdwadaV9Q8I8u8e8lb99ba69ldXetaMcp948Nen9k7H8L7Z6p8F80bc6W8t8t7/7+az8o8L898M6Z7e7Fao838G7GbQcB90am7v7ebV8c=808G=7d6z3V*02b2bA8w=*0285!!ar8X!*0daV8La08c!*0c00*06!*057x6s!*3J=*05!*0p=*0Vc6amc6amc6amc6amc6am=*03czaJczaJczaJczaJczaJ=*07!*0g00*043Y3Y!7QfEfE!!3Y*02!7U*02!5x5xak!*02fE!*0200*04!bR!*073Y3Y!!5x!*052i!*0q00*04!00*094b!*024b*0a4P4b*0e!*0r8H6Y!*0y00*0w!*0x5H!!fNaa!*09aL!*02ar!*06cM!*3i8E!*029V!*07b9!b97U!!2i!*023Y7U!*02bQ!*0b7U!*0r7U!*0m=!*027U7U!*2p",
|
||||
italic: "3e3Y6Q7U6Y7Ua73L5x5x7U7U3Y*024b8n5l6M7g7P7a87728d833Y3Y7U*025xe+9q8y7J9f7x778U9m3N608C77ca9wa48ba48G7D7U9O8Pe48Q807E5x3L5x7v7E4i7v8s6C8q7s5d7Y8d3z3z7D3Bcz8b8i8p8k5I685Q8b7lbA7L756z5x3Y5x7v3e3Y7U6Y7E6Y3Y6z6o9w48767U3Y9w3Q4b7U4b4b4i8Dat3Y3B4b4w76bR*025x=9q*04cd==7x*02=3N*029f==a4*037Ua4=9O*02=847/=7v*04bP==7s*02=3z*028l==8i*037U8i=8b*02=8p=*0f9B9f8q=*0j9C8a=*083z9P6Y=*037D=*044X775o7d3B=*059g9w8b=*05dgcP=*0g6E7U5Q=*0m44!*0h7U!*0cb79D!*0cbC9X!*18=*05!*0n=*03!*2F5+5+!3Q!*0d5+414G3B6M6L!*0B2R2R!*073L!*044i=a83Qa4c46y!br!b7bO4d9q8y73967x7E9ma43N8C96ca9w89a49o8b!7X7U80a78Qava8==8Z6S894d7L8Z807m836S68898s4d8K738G726s8i9j7Q6e8b7u7Lbj7Iaobc=*04!*0e8o7q8B8c!*0t7x7x9r738a7D3N3N60cFcu9G8L9J8d959q8i8y739I7xcO8d9J9J8L9cca9ma48X8b7J7U8dal8Q948CcWdka0bp898sdu8T7v8q7B608p7scX6A8b8b7D7Gam7Z8i8b8p6Cc475aY7L8i7qc3cv869J7871bg7C=7s8b=6S683z*02aXbe81=*027T!!9L80!*0da48i8G7m!*0c00*06!*05736c!*3J=*05!*0p=*0Vb79Db79Db79Db79Db79D=*03bC9XbC9XbC9XbC9XbC9X=*07!*0g00*043Y3Y!7QfEfE!!3Y*02!7U*02!5x5xak!*02fE!*0200*04!bR!*073Y3Y!!5x!*052i!*0q00*04!00*094b!*024b*0a4s4b*0e!*0r8q6Y!*0y00*0w!*0x5H!!eo9w!*099U!*02ar!*06cM!*3i8E!*029V!*07b9!b97U!!2i!*023Y7U!*02bQ!*0b7U!*0r7U!*0m=!*027U7U!*2p",
|
||||
boldItalic:
|
||||
"3j3Y757U6Y7Uap3S5x5x7U7U3Y*024b8C5H737j7+7m8f7j8j8c3Y3Y7U*025xfn9i8X809E7T7v9c9W4o6f907lcGa6ab8Fab977V869X8Zed93887Q5x3S5x7I7I4i7T8w6D8v7x5i8e8n3K3K7N3ZcL8m8n8t8v5O6c5I8i7vbY7Q7n6z5x3Y5x7I3j3Y7U6Y7E6Y3Q6z6o9M4w767U3Y9M3Q4b7U4b4b4i8Dat3Y3B4b4w76bR*025x=9i*04cc==7T*02=4o*029N==ab*037Uab=9X*02=8y8d=7T*04c7==7x*02=3K*028w==8n*037U8n=8i*02=8r=*049l=*099Z9N8v=*0j9W8n=*083Kao7t=*037N=*045e7l5o7l4s=*059/a68m=*05dmcO=*0g6V865I=*0m46!*0h7U!*0cbNab!*0cceaF!*189l=*04!*0n=*03!*2F5+5+!3Q!*0d5+414G3B6M6L!*0B3D3D!*073S!*044i=aG3QaAcI73!co!bncG469l8X7s977T7Q9Wab4o9097cGa68jab9Y8F!7W8688aq93aZak==8X6R8j468f8X847B8c6R6j8j8F468O7l8F7k6q8n9m7V6r8n7x8fbj7GaLbb=*04!*0e8H7q8B8B!*0t7T7T9P7v8l7V4o4o6fcUd29Q90ae8b9G9i8/8X7va27TcL8haeae909jcG9Wab9z8F80868bap939I97dtdRapc18K8odI9a7T8p7C608r7xcN6L8i8i7N7Pax8i8n8m8t6Dch7naT7Q8t7mchcH8ran7q75bt7E=7x8b=6T6c3K*02b4bm81=*0284!!a48g!*0dab8i9K82!*0c00*06!*057v6n!*3J=*05!*0p=*0n7T=*0wbNabbNabbNabbNabbNab=*03ceaFceaFceaFceaFceaF=*07!*0g00*043Y3Y!7QfEfE!!3Y*02!7U*02!5x5xak!*02fE!*0200*04!bR!*073Y3Y!!5x!*052i!*0q00*04!00*094b!*024b*0a4r4b*0e!*0r8v6Y!*0y00*0w!*0x5H!!eo9C!*09a8!*02ar!*06cM!*3i8E!*029V!*07b9!b97U!!2i!*023Y7U!*02bQ!*0b7U!*0r7U!*0m=!*027U7U!*2p",
|
||||
},
|
||||
{
|
||||
name: "Corbel",
|
||||
lineHeight: 1207.51953125,
|
||||
descent: 256.34765625,
|
||||
regular:
|
||||
"38485Gaf81cBat344I4I8q81485d484j82707/75857w8c6I838c484b81*026GfP9X9h9dav8D7Uasar3S5T9t89cSaUbq8Wbz9g8E8Hav9vdO989i994X4j4X817E5m7G8o6S8o7O4+8j8k3E3N7D3EcZ8f8l8j8b5f6k5r867eb8777v6Y4I3z4I81384881*033z6G5mcT5X7D815d9I5m6o814V4E5m9092485m4Q6p7DcLdzc96G=9X*04dS==8D*02=3S*02aK==bq*0381bq=av*02=8T9x=7G*04c9==7O*02=3E*028e==8l*03818l=86*02=8j=*0gaK8o=*0jar8k=*083E977p=*037y=*05894U893E=*058faU8f=*05gwdr=*0h8H5r=*0m4u!*0h81!*0cbS9e!*0cbS9C!*18=*05!*0n=*03!*2F5m5m!5m!*0d5m*05!*0B3d3d!*07=!*045m5m9X=9UbJ57!cm!bccq459X9h879Q8D99arbq3S9t9PcSaU8Wbqan8W!9b8H9gbU9sbcbF==8L7b8L458x8N8D7A8k7b728L8v45897C907p6Q8l8/8r6v8F6W8xaC7waYbX=*04!*0e8J7S8G8p!*0t8D8DbD87908E3S3S5Tfyf0bG9taU9eae9X9p9h7ZbA8DdK8maUaU9tagcSarbqam8W9d8H9ebI9sb69FekfbaQcd9m92ez9z7G8c7H6t967Oau6J8z8z7s8d9X8k8l8a8j6S6U7var7h8Z7Cbbc18ta97C7dbs7Q=7O8G=7c6k3E3E3NccbL8L=*028a!!a37/!*0db18baf7X!*0c00*06!*058q6T!*3J=*05!*0p=*0VbS9ebS9ebS9ebS9ebS9e=*03bS9CbS9CbS9CbS9CbS9C=*07!*0g00*045d5d!7Ec+c+!!3r*02!6b*02!7g7g6X!*02co!*0200*04!hP!*074B4B!!6G!*053v!*0q00*04!00*095f!*02594F5e4g5k5e5f*022X2X6r5f4Q4V4O594K5g4g5k5g5f*022X2X!*0r8o81!*0y00*0w!*0x7Q!!gAcT!*09dn!*02bv!*06cM!*3i82!*029Q!*07aP!8K81!!3v!*0248a5!*02c0!*0b5t!*0r81!*0m=!*028181!*2p",
|
||||
bold: "3e4A6bap8fcXaQ3i4O4O8g8f4Z5d4A4C837L7P7E8g7F8C7E8I8D4A4Z8f*0271g0ah9L98aN8U89awaW4k6i9U8qcWbobu9pbU9Q918WaY9+ee9Y9W9p4X4C4X8f7E67838J6V8K81588C8M3V47843Ydk8H8G8C8C5u6E5X8x7HbJ89827k4N3J4N8f3e4A8f*033J7167cT6e828f5d9I676o8f5f5067909m4A675j6I82dde8cD71=ah*04eC==8U*02=4k*02bk==bu*038fbu=aY*02=9p9K=83*04cu==81*02=3V*028x==8G*038f8G=8x*02=8C=*0gbk8K=*0jaW8M=*083Vad7P=*028984=*058q5S8q3Y=*058Hbo8H=*05gndB=*0h8W5X=*0m4F!*0h8f!*0ccn9S!*0ccLaA!*18=*05!*0n=*03!*2F6767!67!*0d67*05!*0B3d3d!*074b!*046767ah=aFcI65!c/!cbdi4rah9L8xa48U9paWbu4k9Ua7cWbo9kbuaD9p!9r8W9Lcl9YbybT==977w9b4r8B978/8c8F7w7g9b8X4r8x8a9r7Q7h8G9w8R6M92728BaX8hbuc0=*04!*0e8J7U8G8B!*0t8U8UbW8n9s914k4k6ifFfqc19Ubo9Iauah9K9L8nbS8Ue+8Wbobo9UarcWaWbuaz9p988W9Ic49Ybg9Wexfjbcd49K9sfsa9838x7V6o8W81bq758Q8Q7P8kaf8B8G8s8C6V6R82aQ898N7YbrbO90aL7Y7qbQ82=818P=7q6E3V3V47coc88W7T=7z8r!!an8y!*0dbf8waL8m!*0c00*06!*058H75!*3J=*05!*0p=*0Vcn9Scn9Scn9Scn9Scn9S=*03cLaAcLaAcLaAcLaAcLaA=*07!*0g00*045d5d!7Ec+c+!!3P*02!77*02!7q7q6X!*02dJ!*0200*04!ip!*074G4G!!7b!*053v!*0q00*04!00*095B!*025A575y4P5U5y5B*023g3g6Y5B5j5f505t575y4P5U5y5B*023g3g!*0r8K8f!*0y00*0w!*0x7M!!hNcT!*09dn!*02bv!*06cM!*3i8s!*029Q!*07aU!8K8f!!3v!*024Aat!*02c6!*0b5t!*0r8f!*0m=!*028f8f!*2p",
|
||||
italic: "38485w9S7TcX9Y2W4r4r8o814953494j7V767U767S7D7X6z7U7X494981*026vfy9z9f8Paa8c7uavae3W5H8X7NcnayaV8VaV958z85a58Ydr948o8T4R4j4R817E5m7W7E6v81784W7P8a3l3x763Mce867H7Q7K4+6e5l7O7jb8787m6H4A3z4A8138487T*033z6G5mcT6d7v81539I5m6o814Q4x5m9092485m4A5Y7vd3dUcl6v=9z*04c/==8c*02=3W*02am==aV*0381aV=a5*02=8z9r=7W*04b+==78*02=3l*027J==7H*03817H=7O*02=7Q=*0b6S=*03am81=*0jae8a=*083l9m6S=*0371=*044w7N5m7N3M=*0586ay86=*05fycj=*0h855l=*0m4C!*0h7T!*0cbX8I!*0cc49s!*18=*05!*0n=*03!*2F5m5m!5m!*0d5m*05!*0B3d3d!*07=!*045m5m9z=9tbt5b!bQ!aoc73M9z9f899t8c8TacaV3W8X9mcnay8TaVa68V!95858xbr94aMbc==8z6Q7Y3M7+8z81777W6Q6f7+873M7M7v8A7e6l7H8n8f61866d7+ae7FaFbr==7K==!*0e8J7S8G8p!*0t8c8cbj898U8z3W3W5HfaeDbs8Xay8t9R9z9g9f89bf8ccz8Cayay8Xa5cnacaVa68V8P858tbu94at9oe2eyayc09d9aeh9k7W7N7t6s7Z78ci6T8f8f7n8kaz8d7H867Q6vce77aD788f7uc2c28eac7y6WaL7K=787V=6P6e3l3l3xbVbL7/==7m8l!!a27R!*0daL7A8X6Z!*0c00*06!*058e6q!*3J=*05!*0p=*0VbX8IbX8IbX8IbX8IbX8I=*03c49sc49sc49sc49sc49s=*07!*0g00*045353!7Ec+c+!!3r*02!616b6b!7g7g6X!*02cq!*0200*04!ia!*074v4v!!6G!*053v!*0q00*04!00*095b!*02554F594j5n595f*022X2X6f5b4A4Q4x554F594j5n595f*022X2X!*0r817T!*0y00*0w!*0x7Q!!fNcT!*09dn!*02bv!*06cM!*3i7N!*029Q!*07aF!8K81!!3v!*0248a5!*02c0!*0b5t!*0r81!*0m=!*028181!*2p",
|
||||
boldItalic:
|
||||
"3e4A6ba686dwb93i4O4O8g8f515d4I4C7Q7x7P7b857E8u758y8z4L4W8f*0271fCa79w93ay8x7RaCap4d66998qctaQb19ab69l8P8Taj9Ke99W8T9o4X4C4X8f7E678q7V6P8t7A5E848v3R427B4gcw8r8080825C6y5S8d7Kbr7R7H784N3J4N8f3e4A868g86863J7167cT6V7Q8f5d9I676F8f5b516790934A67586r7QdKezd671=a7*04el==8x*02=4d*02aY==b1*038fb1=aj*02=959V=8q*04cb==7A*02=3R*0281==80*038f80=8d*02=80=*0gaY8t=*0jap8v=*083Ra57T=47=897B=*04538q5S8q4g=*058raQ8r=*05fIcD=*0h8T5S=*0m4P!*0h86!*0ccr9o!*0ccOak!*18=*05!*0n=*03!*2F6767!67!*0d67*05!*0B3d3d!*074Z!*046767a7=9ObJ5u!c1!bzcw4ba79w8Hao8x9oarb14d9j9VctaQ9Fb1al9a!9G8T9DbF9WbTbB==997g8D4b8i998e7x8k7g6V8D8/4b877Q927U6V809f8x6u8s6/8iaG8kbabI=*04!*0e8J7U8G8B!*0t8x8xbJ8t928P4d4d66f5eLbY99aQ9da3a79q9w8tbU8xeq8zaQaQ99acctarb1al9a938T9dbD9WaB9Jegf0aRcO9k9meU9A8q898a6O8c7AcA7b8P8P7D8Wb38t808r806Pcw7HaV7R957NcycQ8QaX7X78b77T=7A8n=7c6y3R3R42coc48q=*028P!!at86!*0daT7S9K7O!*0c00*06!*058v6T!*3J=*05!*0p=*0Vcr9ocr9ocr9ocr9ocr9o=*03cOakcOakcOakcOakcOak=*07!*0g00*045d5d!7Ec+c+!!3P*02!747a7a!7q7q6X!*02eU!*0200*04!j1!*074B4B!!7b!*053v!*0q00*04!00*095B!*025w4Y5w4K5K5w5B*023g3g6V5B585b4Y5w4T5w4K5K5w5B*023g3g!*0r8t86!*0y00*0w!*0x7/!!hscT!*09dn!*02bv!*06cM!*3i8u!*029Q!*07aP!8K8f!!3v!*024AaN!*02c6!*0b5D!*0r8f!*0m=!*028f8f!*2p",
|
||||
},
|
||||
{
|
||||
name: "Constantia",
|
||||
lineHeight: 1220.703125,
|
||||
descent: 249.0234375,
|
||||
regular:
|
||||
"3X4j5D8E6UcRaB365N5N6N8E405D406j8r4V7A798j7s8t7z8p8y40408E*026Pdbay9labbL958raZcn5k4Vaj8Ie9bJcA96cA9T7+9BbEavfYah9h915p6j5p8E7Q6q7w8J7d8T7v4S7Y944r498n4pdy968t8M8F5/6l5x8V7zbs7w7x7w5w5s5w8E3X40767A8E8d5G8s6qcs4G808E5D6s6q5n8E5E5E6q8E8Y406q5E5b80cU*026K=ay*04e2==95*02=5k*02bL==cA*038EcA=bE*02=999y=7w*04by==7v*02=4r*028A==8t*038E8t=8V*02=8J=*0f9NbL8T=*0jcn94=*055i==4rac8A=*038p=*045j8I5p8I4p=*05aQbJ8Q=*05frcW=*0h9B5w=*0m4r!*0h8E!*0cdZa1!*0cdlaf!*18=*05!*0n=*03!*2F6q6q!6q!*0d6q*05!*0B473u!*07=!*046q6qay=awdP6M!d1!bCcN4say9l8Cag9591cncA5kajave9bJ9NcAc396!9x9B9hbjahd1cq5b=8R6S8B487W8R8N7d816S6t8B8h488t8q8M7n6L8q8W8r7h8J6X7WaN7Mayb1=*04!*0e8a6O!*0v9595bB8Caq7+5k5k4VeVg3cBavcu9UbVay9q9l8Cb095e+8Fcucuavb3e9cncAc396ab9B9Ub7ahc3aGghgmbjdx9aaEgBa27w8F7L6Y8y7vbs789v9v8h8IaB9j8t948M7d7z7xaK7w998AcscC96bg7w7yc586=7v8w=7u6l4r4r49bEc494=*0294!!aL8X!*0dcm8taR80!*0c00*06!*058C6Y!*3J=*05!*0p=*0VdZa1dZa1dZa1dZa1dZa1=*03dlafdlafdlafdlafdlaf=*07!*0g00*045D5D!7QfEg3!!3f3f3u!5H5H5/!8F9q4V!*02bh!*0200*04!iD!*074P4P!!6Y!*052t!*0q00*04!00*095E!*025E*083Q3Q5A5E*0c3Q3Q!*0r8E84!*0y00*0w!*0x7e!!eXcs!*09a+!*02=!*06e7!*3i8d!*02ag!*07ci!9M8E!!2t!*02409o!*02dD!*0b64!*0r8E!*0m=!*028E8E!*2p",
|
||||
bold: "3L4N5I8E6PcRbm3b62626U8E4u5u4u6j915J7B798b7j8A7o8n8y4u4u8E*0276dNatalakcm9q8PbAcY675Hbr91eDbQcZa2cYb18f9Jb/anflaK9F9d5z6j5z8E7Q6q8o9x7A9I8q5y8x9Z5c4W9x59eEa09n9z9t6O79669P86bX8m807Y5F5x5F8E3L4j768h8K8d5G8P6qcs5x858E5u6u6q5n8E5E5E6q9H9o4u6q5E6285cU*026/=at*04eu==9q*02=67*02b+==cZ*038EcZ=b/*02=a7aB=8o*04cx==8q*02=5c*029r==9n*038E9n=9P*02=9x=*058q=*08aNcm9I=*0jcY9Z=*05694V=5cbn9P=*039A=*046e916G915g=*05c3bQ9L=*05ftdS=*0d9I=9I=9I66=*0a9R=*0a5b!*0h8E!*0cfjbD!*0ceHbR!*18=*05!*0n==9I=!*2F6q6q!6q!*0d6q*05!*0B4t3N!*07=!*046q6qat=aMei7t!dv!bzd05catal8Raf9q9dcYd167braoeDbQadcZcIa2!9U9I9FcoaKelcR==9t7z9w4U8P9t9J8l8M7z7a9w9e4U9l8H9H8b7p9k9G9k7y9s7F8PbF8EbCc9=*04!*0e8x72!*0v9q9qc38RaQ8f67675HfFgJc/brd2asczatanal8Rbt9qgC9zd2d2brbAeDcYcZcIa2ak9IasbIaKcFbnh5habYf9aab9hDaY8o9i8H7v8Y8qd47xagag9h9pb0ad9n9Z9z7A8180b+8ma39ydxdD9ScO8w7Sd895=8q9p=7G795c5c4Wczdf9U=*02a0!!bz9S!*0dcQ9naM8u!*0c00*06!*058Q7n!*3J=*05!*0p=*0VfjbDfjbDfjbDfjbDfjbD=*03eHbReHbReHbReHbReHbR=*07!*0g00*045u5u!7QfEg3!!3x3x3M!6c6c6w!8F9q4V!*02bM!*0200*04!iD!*074U4U!!7v!*052t!*0q00*04!00*095E!*025E*083Q3Q6K5E*0c3Q3Q!*0r8E84!*0y00*0w!*0x7j!!f+cs!*09aS!*02=!*06e7!*3i8E!*02af!*07cW!a78E!!2t!*024u9A!*02dD!*0b6B!*0r8E!*0m=!*028E8E!*2p",
|
||||
italic: "3I4j5p8E6UcUbt2Y5L5N6N8E405i40698r4Q7c79877h8t7z8p8t40408E*026Pdbal9ba5bK8V8gaBcc5i4Uag8xdYbmcb8+cb9M7Z9qbqarfHa49g8T5p695p8E7Q6q828279876/4J7Y8C4g46804ed28K8b8a7+636C5E8I79aT7M7w7C5w5s5w8E3I40767A8E8d5G8s6qcs4+7L8E5i6s6q5n8E5E5E6q8q8Y3Q6q5E4/7LcU*026K=al*04e2==8V*02=5i*02bK==cb*038Ecb=bq*02=919e=82*04bo==6/*02=4g*028f==8b*038E8b=8I*02=82=*0f9abK87=*0jcc8C=*055b==4ga98m=*0385=*045h8x538x4e=*05a1bm8x=*05f5cj=*0h9q5O=*0m49!*0h83!*0cd99L!*0cd4ai!*18=*05!*0n=*03!*2F6q6q!6q!*0d6q*05!*0B473u!*07=!*046q6qal40aldE6K!cD!bAcT4lal9b8ra38V8Tcccb5iagaidYbo9DcbbW8+!9u9q9gbfa4cWcv==8B6f853+7J8B8u6Z7J6f65857R3+7Q7Z8r726j7S8z7+6x8w6D7Ja97laraB=*04!*0e8k6O!*0v8V8Vbm8raa7Z5i5i4UeAfKcmarck9UbLal9a9b8raZ8Vfv8uckckaraXdYcccbbW8+a59q9Ub0a4bUapfZg7b5dt91atgra2828f7n6o8g6/e86O8I8I8a8ob78R8b8K8a79d27waD7M8J7Vc0c58cbd7C7cbH84=6/8i=7a6C4g4g46bDbW8C=*028I!!aFbW!*0db+8bay7z!*0c00*06!*058l6y!*3J=*05!*0p=*0Vd99Ld99Ld99Ld99Ld99L=*03d4aid4aid4aid4aid4ai=*07!*0g00*045i5i!7QfEg3!!3b3b3p!5D5D5W!8F9q4V!*02a+!*0200*04!iw!*074I4I!!6W!*052t!*0q00*04!00*095E!*025E*083Q3Q5r5E*0c3Q3Q!*0r8E84!*0y00*0w!*0x7e!!e9cs!*09a+!*02=!*06e7!*3i8d!*02ab!*07ci!9M8E!*053Q9o!*02dD!*0b64!*0r8E!*0m=!*028E8E!*2p",
|
||||
boldItalic:
|
||||
"3B4N5G8E6UcRbV3960626U8E4u5d4u6j915J7B798b7j8A7o8n8y4u408E*0276dNar9Xamcq9l8JbncY655GbD8+ezbgcQ9EcQaL8y9Gbuanf4at9E9o5z6j5z8E7Q6q938/7F95825A8X9z534V914/ec9H9a958+6U776u9G7+bT8t887Y5x*028E3B4j768h8K8d5G8Y6qcs5/7+8E5d6u6q5n8E5E5E6q9o9z4k6q5E627+cU*026/=ar*04ew==9l*02=65*02cq==cQ*038EcQ=bu*02=9Kak=93*04cI==82*02=53*029k==9a*038E9a=9G*02=8+=*04as=*09ascq95=*0jcY9z=*0853bK9X=*0397=*046l8+6z8+4/=*05bZbg9u=*05fEdy=*0h9G6u=*0m4Z!*0h8E!*0ceSbt!*0ce4bZ!*18=*05!*0n=*03!*2F6q6q!6q!*0d6q*05!*0B4t3N!*07=!*046q6qar4uaHei7r!dm!bxdt5aar9X8Ra89l9ocYcX65bDaoezbga3cQcT9E!9P9G9EbZateacG==9S76964L8E9B9A7U8J766V968N4L8P8o9o7P7f959p90719G7z8Ebj8ubzbE=*04!*0e8x6U!*0v9l9lbR8Ram8y65655Gf0gecQb3d3afcxar9S9X8Rbt9lfZ91d3d3b3btezcYcQcT9Eam9GafbtatcHb0gRg/bueM9HazhKaI939g857l9d82eX7p9G9G9g8/bT9O9a9H957Fec88bF8t9H8WdGdK91cL8u7vdc8R=829f=7G7753534Vcod19z=9O=9G!!aUc+!*0dct9aau89!*0c00*06!*058R7b!*3J=*05!*0p=*0VeSbteSbteSbteSbteSbt=*03e4bZe4bZe4bZe4bZe4bZ=*07!*0g00*045d5d!7QfEg3!!3s3s3M!67676t!8F9q4V!*02bM!*0200*04!iD!*074N4N!!7v!*052t!*0q00*04!00*095E!*025E*083Q3Q6k5E*0c3Q3Q!*0r8E84!*0y00*0w!*0x7j!!fTcs!*09aS!*02=!*06e7!*3i8B!*02a8!*07cW!a08E!*054k9A!*02dD!*0b6B!*0r8E!*0m=!*028E8E!*2p",
|
||||
},
|
||||
{
|
||||
name: "Book Antiqua",
|
||||
lineHeight: 1205.56640625,
|
||||
descent: 282.2265625,
|
||||
regular:
|
||||
"3W4m5P9u7Qd8ca3g5d5d659u3W5d3W9u7Q*093W3W9u*026YbHca9zb5c69z8IbXd05h5dbm9zeOc/ci9scias8d9BcabifEar*025d9u5d9u7Q5d7Q8F6Y9z7v5d8I964z3G8I4zdP968y9p8M6b6E569r8Rd2848I7Q5d9u5d9u3W4m7Q7Q9u7Q9u7Q5dbH5d7Q9u5dbH7Q6g8B4S4S5d909Q5d5d4S5d7Qcj*026Y=ca*04eM==9z*02=5h*02c6==ci*039ud1=ca*02=9s8I=7Q*04bS==7v*024v*038y==8y*038B8I=9r*02=9p=*0fbqc69z9z=*0id096=*084vau8d=*038A=*046v9z5x9z4z=*05bTcl93=*05fCcX=*0g6S9B56==cc=*0dar=*044z!*0h7Q!*1C=*05!*355d5d!5d!*0d5d3W5d4V5d5Y!*0L=!*045d5dca=aze46a!cQ!bIbZ4+ca9z8hap9zard0ci5hbmcaeOc/9/cicG9s!a99BarbqardDbA==9y6q8X4+8E9y8+8q8C6q6U8X7+4+8s899o8z6U8y9u8W6z8v6L8Eal8bbUaJ=*04!*0N9zbO8AaY8d5h5h5dfagrbSbm!bbcKca9z9z8AbM9zfY8Qd0d0bmbseOd0cicK9sb59BbbdkarcKbShhhjaMec9haYhIas7Q8P7G6S8U7vby6q9S9S8u8OaS9S8y9B9p6Y7w8Id2849G8VdLdQ8Ubw7K7ncw8f!=8U=726E4z4v3GbScS96=!=9B!*0y00*06!*057m5P!*3J=*05!*1H==!*0m00*04!5d!7QfEbK!7Q4m*037Q*02!7Q7Q9u!*02fE!*0200*04!hU!3g5P!*045b5b!7P!7Q!*042D!*0q00*04!00*09!*0e6o!*0y8I7Q!!iA!*037Q!*0y00*0w!*0jbI!*0c6W!!hl!*0afj!*02c0!*069o!*0Hcj*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2D!*023W8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
bold: "3W4m6i9u7QdVd13z5d5d6Y9u3W5d3W4E7Q*093W3W9u*026YbHcaarbid19z8Id1d16565ca9zfEd1d19zd1bi9zarcacafEar*025d9u5d9u7Q5d7Q9z6Y9z7Q658I9z5d5d9z5ddV9z8I9z9z656Y5d9z8Id17Q8I7Q4S9u4S9u3W4m7Q7Q9u7Q9u7Q5dbH6S7Q9u5dbH7Q6g8B5F5F5d90a15d5d5F7E7QdVdWdV6Y=ca*04fE==9z*02=65*02d1*069ud1=ca*02=9z9z=7Q*04ca==7Q*02=5d*028I==8I*038B8I=9z*02=9z=*0fbyd19z9z=*0id19z=*085dcaaq=*039A=*04719z6b9z5d=*05cJcQ9I=*05fEd1=*0g6Aar5d=*0gar=*045d!*0h7Q!*1C=*05!*355d5d!5d!*0d5d*05!*0L=!*045d5dca=atd/74!cZ!bVbV5ucaar8MbG9zard1d165cacafEd1amd1c+9z!9NarareoareTbU==9C7a9j5u8W9C8P8c8M7a7m9j7F5u9y839y8v7m8I9N8T7m91758Wbr8kc+cc=*04!*0N9zcf8Ibh9z65*02fVgecnca!bKd1caanar8IbL9zh79zd9d9cab+fEd1*029zbiarbKepard3cpiwiwbHfKabbhiZbi7Q8Z8L769c7Qdr7aalal9y9Mbwag8Iag9z6Y7T8Id57Qag9KeEeE9Gd98w7qdl96!=9f=6Y6Y5d*02cWdr9z=!=ag!*0y00*06!*058d6p!*3J=*05!*1H==!*0m00*04!5d!7QfEbK!7Q4m4m5d4m7Q*02!7Q7Q9u!*02fE!*0200*04!fE!3z6i!*046565!97!7Q!*042D!*0q00*04!00*09!*0e6H!*0y8I7Q!!jf!*037Q!*0y00*0w!*0jch!*0c6i!!hE!*0afC!*02c0!*069o!*0HdV*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2D!*023W8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
italic: "3W5d7Q9u7QdVca5d*02659u3W5d3W4E7Q*093W3W9u*027QbHbi9zarca9z8Ibica5d5dar8IeMcaca9zcaar8I9zcabieMbiarar5d9u5d9u7Q5d6Y7f6n7Q654m7Q7Q4m4m6Y4mca8I6Y7Q7f65655d8I7Qbi7Q7Q6Y5d9u5d9u3W5d7Q7Q9uar9u7Q5dbH5d7Q9u5dbH7Q6g8B4S4S5d907Q5d5d4S5d7Qcj*027Q=bi*04eJ==9z*02=5d*02ca*069uca*04=9z7Q=6Y*049+==65*02=4m*026Y==6Y*038B6Y=8I*02=7Q7Q=*0e9dca7Q=*0c7P=*05ca7Q=*084maq8I=*037x=*045l8I5b8I4m=*05aXc18p=*05g4at=*0g5W9z5d=*0gar=*044m!*0h7Q!*1C=*05!*355d5d!5d!*0d5d*05!*0L=!*045d5dbi=aBdg6h!cb!bPce4mbi9z88ai9zarcaca5darbieMcaaecabA9z!9l9zarcQbibica==775R8y4m7J777U7L6Z5R6I8y7v4m7y7M8M7z6B6Y8d7c6q7r6q7J9Y7Yaqa8=*04!*0N9zb+89ar8I5d*02eNfAbmar!avbFbi9v9z89bb9zeO8LbRbRarbbeMcacabF9zar9zavcTbibFbwfRfRaSel9aaJgx9I6Y79736a7265b35S8I8I7A7FaD8j6Y8I7Q6nca7QbP7Q8I8bcrcr6w9W6q6xal7R!=7F7f6n654m*029Cah7Q=!=8I!*0y00*06!*057X5t!*3J=*05!*1H==!*0m00*04!5d!7QfEbK!7Q4m*037Q*02!7Q*02!*02fE!*0200*04!fE!5d7Q!*045d5d!8r!7Q!*042D!*0q00*04!00*09!*0e68!*0y8I7Q!!gI!*037Q!*0y00*0w!*0jb3!*0c6k!!hd!*0afE!*02c0!*069o!*0Hcj*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2D!*023W8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
boldItalic:
|
||||
"3W5d7Q9u7QdVd13W5d5d6Y9u3W653W4X7Q*093W3W9u*026Yd1biaraJca9z8Icaca6565bi9zeMcad1ard1bi8I9zcaarfEbi9zar5d9u5d9u7Q5d8I8p6Y8I6Y5d7Q8I5d5d8I5dd18I*028p656Y658I8Id17Q8I7Q5d9u5d9u3W5d7Q7Q9u7Q9u8I5dbH5d7Q9u65bH7Q6g8B5F5F5d908I5d5d5F5d7QdV*026Y=bi*04eM==9z*02=65*02caca=d1*039ud1=ca*02=ar8I*06by=6Y*03=5d*028I*068B8I*07=*0eaoca8I=*0jca8I=*085dcaaq=*038K=*046O9z6N9z5d=*05bucI8M=*05eMca=*0g6x9z65=*0m4x!*0h7Q!*1C=*05!*355d5d!5d!*0d5d*05!*0L=!*045d5dbi=aWdx7i!cT!bxc85dbiar8ian9zarcad165bibieMcaacd1bUar!9o9z9zeybidHc2==8N7w8u5d8+8N8C8n8M7w738u945d8M7W8M8M738I9b8M75987y8+bA8LbdbI=*04!*0N9zbR8maJ8I656l65g8g5bybi!arc1biaqar8mbL9zhp9ac4c4bibPeMcad1bSaraJ9zarevbibSbDi5hHbXfraqaBi2b18I8I8k6L8H6YcC6k8I8I8Q88b38Y8I*026Yd18IcV7Q8I8ocEcE7EbJ7B7occ8A!=8w7E6Y6Y5d*02aSbC8I=!=8I!*0y00*06!*05855L!*3J=*05!*1H==!*0m00*04!65!7QfEbK!7Q4m4m3W4m7Q*02!8I8I9u!*02fE!*0200*04!fE!3W7Q!*045d5d!9W!7Q!*042D!*0q00*04!00*09!*0e68!*0y8I7Q!!jg!*037Q!*0y00*0w!*0jcd!*0c69!!hu!*0afE!*02c0!*069o!*0HdV*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99u!!2D!*023W8B!*02b9fj!*089d!4i!*0r8B!*0m8B9u!!8B8B!*2p",
|
||||
},
|
||||
{
|
||||
name: "Franklin Gothic Book",
|
||||
lineHeight: 1133.7890625,
|
||||
descent: 217.28515625,
|
||||
regular:
|
||||
"3W4d4Y9a9abgar2R4B4B9a9a3W*02769a*093W3W9a*027VbF8o9s93a78A7Ya7a33W5S9Q7GcGah9T8L9T9B8V7B9u8pcN887+894B764B7Q*028h8p7i8r894I7H8s3B3B7R3CcK8u888m8o5a7g4Q8u72ao6E6v6D4B7Q4B9a3W4d9a9aar9b7Q9a7Qc55t5o9a3Wc57Q9a9a63637Q8n9a1J7Q635o5odM*027V=8o*04ea==8A*02=3W*02a7==9T*039a9T=9u*02=8S8T=8h*04d9==89*02=3B*0286==88*039a88=8u*02=8m=8D=*0d9Ra78r=*0ja38s=*083B9I77=*037R=*044W7G5j7G3C=*05aza38u=*05f3dl=*0g587B4Q=*0m9a!*0h9a!*1C=*05!*357Q7Q!7Q!*0d7Q*05!*0L=!*047Q7Q8u=8Aa33W!9T!7+9Z3v8o9s6Z998A89a39T3W9Q8LcGah7X9T9K8L!7F7B7+bq88bV9Z==976Y8k3v7X978s6H806Y5G8k8c3v7x6t8n726q888m8h747+6k7X9O70aEaw=*04!*0N8n9B6G9d8V3W3W5Screh9I9s!80a38o929s6G9A8Acc8wabab9Q8LcGa39T9R8L937B80bq88a69fe8ef9McD8C9ddQ9r8h8i8c5E7v899+6R8k8k7p6TaO8n88868m7i5w6v9O6E847Fb+c17YaG7j7rbF7V!=7W=7r7g3B*029ObT7X=!6q84!*0y00*06!*056Z5E!*3J=*05!*1H==!*0m00*04!3W!9aarar!7Q3W*036h*02!9a9aar!*02bF!*0200*04!gB!2V4Y!*043m3m!7Q!9a!*041G!*0q00*04!00*09!*0e5B!*0y7Y9b!!f7!*039a!*0y00*0w!*0jel!*0c9a!!fE!*0ac9!*02c0!*069o!*0HdM*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99a!!1G!*021J8B!*02b9fE!*08bf!4i!*0r8B!*0m8B9a!!8B8B!*2p",
|
||||
italic: "3W4b4R9a9ac5ar2O4B4B9a9a3W*027l9a*093W3W9a*027ObH8Q9z90a88L7Xabag3U5N9L7ZcLafa28J9/9V8Y7E9D8gcI8r808d4B7l4B7Q*028n8q7q8q884I7T8w3B3B7G3BcN8A898o8l5j7d4P8u6Yay6Q6F6z4B7Q4B9a3W4c9a9aar9a7Q9a7Qc55w5h9a3Wc57Q9a9a63637Q9a9a217Q635n5hdM*027O=8Q*04dG==8L*02=3U*02a8==a2*039aa2=9D*02=8P8G=8n*04d9==88*02=3B*027/==89*039a89=8u*02=8o=*0f9Da88q=*0jag8w=*083B9B77=*037H=*044P7Z5k7Z3P=*05aJag8A=*05fhe0=*0g4/7E4P=*0m9a!*0h9a!*1C=*05!*357Q7Q!7Q!*0d7Q*05!*0L=!*047Q7Q8n=8Lag3U!a2!89ah3C8Q9z76908L8daga23U9L8EcLaf86a29V8J!7P7E80bH8rc9ah==9n718w3C879n8y6M87715S8w8i3C7H6y8z6Y6D898u8p7p856d87a675aMaF=*04!*0N8x9M769u8Y3U3U5Nclew9S9m!7Paa8Q9a9z6O9E8LbN8Eakak9L8EcLaga29Z8J907E7PbH8rag9nemev9XcO8J9oe29E8n8q8i5K7r889e6W8w8w7H6yb18t898i8o7q5A6F9l6Q8h7wcfcj83aV7r7ubK81!=82=7C7d3B*029xc1827z!6m8f!*0y00*06!*05735K!*3J=*05!*1H==!*0m00*04!3W!9aarar!7Q3W*035S*02!9a9aar!*02bK!*0200*04!hI!2O4R!*043j3j!7Q!9a!*041G!*0q00*04!00*09!*0e5E!*0y7X9a!!dZ!*039a!*0y00*0w!*0jel!*0c9a!!fE!*0acr!*02c0!*069o!*0HdM*03!*0MfE7QfE7QfE7Q!*0h7Q!*1o7K!*029A!*07cT!b99a!!1G!*02218B!*02b9fE!*08bf!4i!*0r8B!*0m8B9a!!8B8B!*2p",
|
||||
},
|
||||
{
|
||||
name: "Gill Sans MT",
|
||||
lineHeight: 1159.66796875,
|
||||
descent: 230.46875,
|
||||
regular:
|
||||
"4m4f5y988uaA9N2Y53536x983r533r4p7Q*093r3B98*025dfOar8Pb4bK7Q7lbAbp3W3Wag7GcdcdcT7+cT9s7a9sb49sgib49sa65d4p5d7l8E5d6H7Q6S7+7v3W6H7Q3r3r7v3rc37Q8E7Q7Q6c615d7Q6Sbf7Q6S6x5d445d974m4f6S8j8E8E446m5dbA4p7G9853bA8E6c9853535d8E8u5d5d535J7Gdc*025d=ar*04e0==7Q*02=3W*02bK==cT*0398cT=b4*02=7+7Q=6H*04ar==7v*02=3r*028P==8E*03988E=7Q*02=7Q=!!=*05!*03=*029ibK7+!*05=*03!*0k3r!*06==!!=4A!!7G3r==!!==!*06==eld1==!!=*03!!=*066S!*07=*03!*05=*06!*0i8E!*4O5d5d!5d!*0d5d*05!*1N8B!*3100*06!*6000*04!53!7QfE!*023r*02!6H6H70!7G7G5y!*02fE!*0200*04!fO!*074V4V!*0836!*0q00*04!00*09!*0X9y!*0y00*0w!*0MfE!*02c0!*3q7K!*029A!*07cT!b9!*0236!*02448B!*02b9!*0b4i!*0r97!*0m97!*029797!*2p",
|
||||
bold: "4m4f7v988ubfbK3M61617l984f5d4f4p8E*094f4f98*025TfjcdaWc3cy9X9scJd15d5dbf9DdRdcdHagdHaB9sbfcTbfifcJb4aW6S4p6S987Q5d8j977Q978E4K8u974f4f8E4fe+979i9797706H6m977+cd8E7+89614p61984m4f7Q898E8E4p895dbA5y9i985dbA7Q6c985d*029D8E5d*026c9ie0*025T=cd*04gN==9X*02=5d*02cy==dH*0398dH=cT*02=ag9s=8j*04cd==8E*02=4f*029D==9i*03989i=97*02=97=!!=*05!*03=*02aWcy97!*05=*03!*0k4f!*06==!!==!!9D4f==!!==!*06==h6dH==!!=*03!!=*068P!*07=*03!*05=*06!*0i8E!*4O5d5d!5d!*0d5d*05!*1N8B!*3100*06!*6000*04!5d!7QfE!*024f*02!8P*02!7+7+5y!*02fE!*0200*04!gX!*075353!*083r!*0q00*04!00*09!*0X9P!*0y00*0w!*0MfE!*02c0!*3q7K!*029A!*07cT!b9!*023r!*024f8B!*02b9!*0b4i!*0r98!*0m8B!*028B8B!*2p",
|
||||
italic: "4m3W5y987Qb4aM2Y4A4A7098363W364p89*09363698*025yfO897+8Eag7+6x9saW3M3M8P6xcJaMag70ag8j7a7+9X7+evar7G975d4p5d7l7Q5d7l7l617l6S4f6H7l2Y2Y7a2YbA7l707G7l4V5y4p7l5T9D6H5T7a5d445d984m3W617l8E8E447G5dbA4V6S983WbA7Q6c9853535d8E8u5d5d534K6Sdc*025y=89*04d1==7+*02=3M*02ag==ag*0398ag=9X*02=707Q=7l*04a6==6S*02=2Y*0270==70*039870=7l*02=7G=!!=*05!*03=*0297ag7l!*05=*03!*0k2Y!*06==!!=4K!!6x2Y==!!==!*06==f9bf==!!=*03!!=*066x!*07=*03!*05=*06!*0i8E!*4O5d5d!5d!*0d5d*05!*1N8B!*3100*06!*6000*04!3W!7QfE!*0236*02!6m*02!7v7a5y!*02fE!*0200*04!fO!*073B3B!*083g!*0q00*04!00*09!*0X8/!*0y00*0w!*0MfE!*02c0!*3q7K!*029A!*07cT!b9!*023g!*02448B!*02b9!*0b4i!*0r98!*0m97!*029797!*2p",
|
||||
boldItalic:
|
||||
"4m447v987Gbfbp3M5o5o7v98445o444p8j*09444498*0253fj9N9XaMbK977GbAco4K4Ka68jeQcdd197d1a6899HbK8EeQaB8P9X5T4p5T977Q5d8E8u7l8u7+5d7G8E44447Z44cT8E8P978E5J5T5J8E7abp8j7G7a614p61984m447l8u8E8E4p8E5dbA5J8u985obA7Q6c9853535d9D8E5d5d535T8udc*0253=9N*04fu==97*02=4K*02bK==d1*0398d1=bK*02=978E*06aM==7+*02=44*028E8E=8P*03988P=8E*02=97=!!=*05!*03=*02aMbK8u!*05=*03!*0k44!*06==!!=6c!!8j44==!!==!*06==gsco==!!=*03!!=*068j!*07=*03!*05=*06!*0i8E!*4O5d5d!5d!*0d5d*05!*1N8B!*3100*06!*6000*04!5o!7QfE!*0244*02!7G*02!8j7+5y!*02fE!*0200*04!gX!*074f4f!*082Y!*0q00*04!00*09!*0X8/!*0y00*0w!*0MfE!*02c0!*3q7K!*029A!*07cT!b9!*022Y!*02448B!*02b9!*0b4i!*0r8B!*0m8B!*028B8B!*2p",
|
||||
},
|
||||
{
|
||||
name: "Impact",
|
||||
lineHeight: 1219.7265625,
|
||||
descent: 210.9375,
|
||||
regular:
|
||||
"2M4e5O9O8zaR902V4V4V4p8l2E4C2V6c8o5Z7S8i7Q8p8u688n8u3a3a8l*028dc77Y8E8G8F6w6e8D8H4w5b8p5Ybd8u8y7S8y8r857d8z8bcK7y7p6d4q6c4q7z8E5d7U887L887/4x878c4i4o7u4ic38b7/87865C7n4N8a6Rat6O705v5O4f5O8d2M4e858n8A7p4f7A5dcg555P8l4Ccg8E5r8l4+565d7n905d5d3R5a5P9Ma5aP8d=7Y*04b9==6w*02=4w*028L==8y*038l8y=8z*02=7S8C=7U*04bN==7/*02=4i*027/==7/*038l7/=8a*02=87=*0fak8L88=*056v=*0c8H8c=*084i9O8F=*0385=*036M6J6G6G5/4u=*05af8F8b=*05aMbZ=*0g7d7d4M=*0m4w!*0h6X!*1C=*05!*0n=*03!*2F5d5d!5d!*0d5d*05!*0L=!*045d5d7Y3s8paB6q!a0!a0af4M7Y8E5Y7Y6w6d8H8y4w8p8cbd8u7d8y8H7S!6a7d7pct7ych8N==8c848b4M8a8c8e7Q7+84608b7/4M8a7C8f6R5+7/8w8563885L8ac07NbAcf=*04!*0N6wal6s8G854w4w5bd8cIal8o!708H7Y8E8E6sac6wbA8i8t8t8o98bd8H8y8H7S8G7d70ct7y8W8VcTd89Jc+8E8icK8q7U8a825p9L7/bH7V8L8L7/8NaH8l7/8k877L6K70c16O8F83cxcS9hcg8a7Qc67/!=8n=7Q7n4i4i4ocUcg8n=!=89!*0y00*06!*056K6k!*3J=*05!*1H==!*0m00*04!4C!7QfEfE!8E2E*035p*02!8v8v5s!*028F!*0200*04!g1!2V64!*043636!8w!9a!*041Z!*0q00*04!00*09!*0352!*095d!*0y6e8n!!k4!*038j!*0y00*0w!*0jaR!*0c9a!!dB!*0acf!*02c0!*069o!*0Harbwbz9T!*0MfE7QfE7QfE7Q!*0h7Q!*1o7G!*029D!*07cT!b48l!!1Z!*023s8B!*02b9fE!*08bf!4i!*0r8d!*0m=8l!!8l8l!*2p",
|
||||
},
|
||||
];
|
||||
/* cspell:enable */
|
||||
|
||||
@@ -67,6 +67,8 @@ export type FaceShaping = {
|
||||
readonly glyphs: FaceKerning["glyphs"];
|
||||
/** The rules of each setting Word's PDFs showed */
|
||||
readonly ligatures: FaceKerning["ligatures"];
|
||||
/** Whether Word leaves the face's text not kerned when it has ligatures */
|
||||
readonly notKernedWithLigatures: boolean;
|
||||
};
|
||||
|
||||
/** The first character of text */
|
||||
@@ -120,7 +122,14 @@ export const decodeFace = (face: FaceKerning): FaceShaping => {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
pairs.set(twoDigits(face.pairs, at) * 4096 + twoDigits(face.pairs, at + 2), value === UNKNOWN ? Number.NaN : value - 2048);
|
||||
}
|
||||
const shaping: FaceShaping = { characters: new Set(characters), classes, pairs, glyphs: face.glyphs, ligatures: face.ligatures };
|
||||
const shaping: FaceShaping = {
|
||||
characters: new Set(characters),
|
||||
classes,
|
||||
pairs,
|
||||
glyphs: face.glyphs,
|
||||
ligatures: face.ligatures,
|
||||
notKernedWithLigatures: face.notKernedWithLigatures === true,
|
||||
};
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
decoded.set(face, shaping);
|
||||
return shaping;
|
||||
@@ -161,10 +170,22 @@ export const joinLetters = (characters: readonly string[], rules: RuleIndex, gly
|
||||
return joined;
|
||||
};
|
||||
|
||||
/** The font's kerning and ligatures in the tables, by its name and face, when they have them */
|
||||
/**
|
||||
* The font's kerning and ligatures in the tables, by its name and face, when they have them. An italic face a font
|
||||
* doesn't have, which Word slants from the upright one, is kerned and joined as the upright one, as Word kerns Trebuchet
|
||||
* MS's bold italic, which it draws as its bold (scripts/layout-probes/stops2/word-stops-font-kerning.ts K18). A bold
|
||||
* face it doesn't have, which Word makes itself, such as Calibri Light's, isn't known
|
||||
*/
|
||||
export const shapingOf = (font: string, bold: boolean, italic: boolean): FaceShaping | undefined => {
|
||||
const faces = FONT_KERNING.find(({ name }) => name === font);
|
||||
return faces === undefined ? undefined : decodeFace(faces[italic ? (bold ? "boldItalic" : "italic") : bold ? "bold" : "regular"]);
|
||||
const face = bold
|
||||
? italic
|
||||
? (faces?.boldItalic ?? faces?.bold)
|
||||
: faces?.bold
|
||||
: italic
|
||||
? (faces?.italic ?? faces?.regular)
|
||||
: faces?.regular;
|
||||
return face === undefined ? undefined : decodeFace(face);
|
||||
};
|
||||
|
||||
/** A glyph's kerning classes: a ligature's own, or a character's */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// cspell:ignore Caladea Aptos Carlito Yvonne Ωmega
|
||||
// cspell:ignore Caladea Aptos Carlito Yvonne Ωmega hhea AVANT GPOS Façade
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
@@ -54,7 +54,7 @@ describe("measureTextWidth", () => {
|
||||
expect(width({ bold: true, italic: true })).to.be.closeTo(boldItalic, 3);
|
||||
}
|
||||
// Fonts that aren't in the tables are measured in the italics of the one most like them
|
||||
expect(measureTextWidth(alphabet, { font: "Georgia", italic: true })).to.equal(
|
||||
expect(measureTextWidth(alphabet, { font: "Garamond", italic: true })).to.equal(
|
||||
measureTextWidth(alphabet, { font: "Times New Roman", italic: true }),
|
||||
);
|
||||
});
|
||||
@@ -77,11 +77,11 @@ describe("measureTextWidth", () => {
|
||||
expect(width("Carlito")).to.equal(width("Calibri"));
|
||||
expect(width("Segoe UI")).to.equal(width("Calibri"));
|
||||
expect(width("Caladea")).to.equal(width("Cambria"));
|
||||
expect(width("Consolas")).to.equal(width("Courier New"));
|
||||
expect(width("Georgia")).to.equal(width("Times New Roman"));
|
||||
expect(width("Fira Mono")).to.equal(width("Courier New"));
|
||||
expect(width("Garamond")).to.equal(width("Times New Roman"));
|
||||
expect(width("Noto Serif")).to.equal(width("Times New Roman"));
|
||||
expect(width("Noto Sans Serif")).to.equal(width("Arial"));
|
||||
expect(width("Aptos")).to.equal(width("Arial"));
|
||||
expect(width("Roboto")).to.equal(width("Arial"));
|
||||
expect(width("Helvetica")).to.equal(width("Arial"));
|
||||
});
|
||||
|
||||
@@ -195,19 +195,34 @@ describe("unknownFont", () => {
|
||||
const PANGRAM = "Thequickbrownfoxjumpsoverthelazydog";
|
||||
|
||||
it("should find the fonts the tables don't have, which Word draws in themselves, or in Cambria when it doesn't have them", () => {
|
||||
// In TX18, Word drew the pangram in Cambria, 3820.8 twips wide, for the two fonts it didn't have, and Aptos 3781.2,
|
||||
// Segoe UI 3616.5, Garamond 3457.5, Georgia 3905.6, Verdana 4384.2, Tahoma 3839.4 and Calibri Light 3540.2 in
|
||||
// themselves, where the tables measure them as Arial (3863.6), Times New Roman (3580.5) or Calibri (3589.3)
|
||||
expect(twips(PANGRAM, "Aptos", 11)).to.be.closeTo(3863.6, 0.1);
|
||||
expect(twips(PANGRAM, "Georgia", 11)).to.be.closeTo(3580.5, 0.1);
|
||||
expect(twips(PANGRAM, "Calibri Light", 11)).to.be.closeTo(3589.3, 0.1);
|
||||
const fonts = ["Watertight Missing Sans", "Watertight Missing Serif", "Aptos", "Segoe UI", "Garamond", "Georgia", "Verdana"];
|
||||
for (const font of [...fonts, "Tahoma", "Calibri Light"]) {
|
||||
// In TX18, Word drew the pangram in Cambria, 3820.8 twips wide, for the two fonts it didn't have, and Segoe UI
|
||||
// 3616.5 and Garamond 3457.5 in themselves, where the tables measure them as Calibri (3589.3) and Times New Roman
|
||||
// (3580.5)
|
||||
expect(twips(PANGRAM, "Segoe UI", 11)).to.be.closeTo(3589.3, 0.1);
|
||||
expect(twips(PANGRAM, "Garamond", 11)).to.be.closeTo(3580.5, 0.1);
|
||||
for (const font of ["Watertight Missing Sans", "Watertight Missing Serif", "Segoe UI", "Garamond", "Roboto"]) {
|
||||
expect(unknownFont({ font }), font).to.equal(true);
|
||||
expect(unknownFont({ font }, "a"), font).to.equal(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("should measure Office's fonts that Word installs with Word's widths (word-watertight-text.docx TX18)", () => {
|
||||
// Word drew the pangram 3781.2 twips wide in Aptos, 3905.6 in Georgia, 4384.2 in Verdana, 3839.4 in Tahoma and
|
||||
// 3540.2 in Calibri Light, to within the 3 twips or so Word's PDFs put text to
|
||||
const drawn = [
|
||||
["Aptos", 3781.2],
|
||||
["Georgia", 3905.6],
|
||||
["Verdana", 4384.2],
|
||||
["Tahoma", 3839.4],
|
||||
["Calibri Light", 3540.2],
|
||||
] as const;
|
||||
for (const [font, width] of drawn) {
|
||||
expect(twips(PANGRAM, font, 11), font).to.be.closeTo(width, 1.6);
|
||||
expect(unknownFont({ font }), font).to.equal(false);
|
||||
expect(unknownFont({ font, italic: true }, "a"), font).to.equal(false);
|
||||
}
|
||||
});
|
||||
|
||||
it("should know the fonts of the tables, and those made with the same widths, which are measured as them", () => {
|
||||
const sameWidths = [
|
||||
["Carlito", "Calibri"],
|
||||
@@ -291,7 +306,7 @@ describe("East Asian fonts", () => {
|
||||
it("should measure East Asian fonts that aren't in the table as MS Mincho or MS Gothic, and not Latin fonts that look like them", () => {
|
||||
expect(measureLineHeight({ font: "Hiragino Mincho ProN", size: 10 })).to.be.closeTo(12.97, 0.0001);
|
||||
expect(measureTextWidth("ab", { font: "ヒラギノ角ゴシック", size: 10 })).to.equal(10);
|
||||
expect(measureLineHeight({ font: "Century Gothic", size: 10 })).to.equal(measureLineHeight({ font: "Arial", size: 10 }));
|
||||
expect(measureLineHeight({ font: "Franklin Gothic Medium", size: 10 })).to.equal(measureLineHeight({ font: "Arial", size: 10 }));
|
||||
});
|
||||
|
||||
it("should make the Latin letters of monospaced ones half an em, and their ideographs and symbols an em", () => {
|
||||
@@ -555,3 +570,162 @@ describe("kerning and ligatures", () => {
|
||||
expect(unknownShaping("f\t\u03a9", calibri({ ligatures: "standard" }))).to.equal(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Office's fonts that Word installs", () => {
|
||||
// Word's PDFs of scripts/layout-probes/stops2: word-stops-font-widths, word-stops-font-italic-widths,
|
||||
// word-stops-font-heights and word-stops-font-kerning, saved from Word 16 for Mac
|
||||
const OFFICE_FONTS = [
|
||||
"Calibri Light",
|
||||
"Aptos",
|
||||
"Aptos Narrow",
|
||||
"Trebuchet MS",
|
||||
"Georgia",
|
||||
"Verdana",
|
||||
"Tahoma",
|
||||
"Century Gothic",
|
||||
"Consolas",
|
||||
"Candara",
|
||||
"Corbel",
|
||||
"Constantia",
|
||||
"Book Antiqua",
|
||||
"Franklin Gothic Book",
|
||||
"Gill Sans MT",
|
||||
"Impact",
|
||||
];
|
||||
|
||||
it("should know each of them, plain, bold, italic and bold italic, but for the bold Word makes itself", () => {
|
||||
for (const font of OFFICE_FONTS) {
|
||||
expect(unknownFont({ font, size: 11 }, "a"), font).to.equal(false);
|
||||
expect(unknownFont({ font, italic: true }, "a"), font).to.equal(false);
|
||||
}
|
||||
// Calibri Light, Franklin Gothic Book and Impact have no bold face, which Word makes itself, each character 18
|
||||
// thousandths of an em wider at 10 points (W), which other sizes haven't shown
|
||||
for (const font of ["Calibri Light", "Franklin Gothic Book", "Impact"]) {
|
||||
expect(unknownFont({ font, bold: true }, "a"), font).to.equal(true);
|
||||
expect(unknownFont({ font, bold: true, italic: true }, "a"), font).to.equal(true);
|
||||
// Guessing, it is measured as the face Word makes it from
|
||||
expect(measureTextWidth("Bold", { font, bold: true, italic: true })).to.equal(measureTextWidth("Bold", { font, italic: true }));
|
||||
}
|
||||
expect(unknownFont({ font: "Trebuchet MS", bold: true, italic: true }, "a")).to.equal(false);
|
||||
expect(unknownFont({ font: "Tahoma", bold: true, italic: true }, "a")).to.equal(false);
|
||||
});
|
||||
|
||||
it("should measure an italic Word slants from the upright face as wide as it, as Word draws it", () => {
|
||||
// Tahoma and Impact have no italic face, and Word draws Trebuchet MS bold italic as its bold, slanted
|
||||
for (const [font, bold] of [
|
||||
["Tahoma", false],
|
||||
["Tahoma", true],
|
||||
["Impact", false],
|
||||
["Trebuchet MS", true],
|
||||
] as const) {
|
||||
expect(measureTextWidth("Slanted", { font, bold, italic: true })).to.equal(measureTextWidth("Slanted", { font, bold }));
|
||||
}
|
||||
// A font with an italic face has its own widths: Georgia's italic a is 573 thousandths of an em, the upright 504
|
||||
expect(measureTextWidth("a", { font: "Georgia", italic: true, size: 1000 })).to.equal(573);
|
||||
expect(measureTextWidth("a", { font: "Georgia", size: 1000 })).to.equal(504);
|
||||
});
|
||||
|
||||
it("should measure the pangram as Word drew it in Aptos, Georgia, Verdana, Tahoma and Calibri Light (word-watertight-text.docx TX18)", () => {
|
||||
const pangram = "Thequickbrownfoxjumpsoverthelazydog";
|
||||
for (const [font, width] of [
|
||||
["Aptos", 3781.2],
|
||||
["Georgia", 3905.6],
|
||||
["Verdana", 4384.2],
|
||||
["Tahoma", 3839.4],
|
||||
["Calibri Light", 3540.2],
|
||||
] as const) {
|
||||
expect(twips(pangram, font, 11), font).to.be.closeTo(width, 1.6);
|
||||
}
|
||||
});
|
||||
|
||||
it("should measure the spaces as Word works them out, and not know the characters a font doesn't have", () => {
|
||||
// S: Word works out the em and three-per-em spaces itself, where Calibri Light's and Tahoma's files have 1000 and
|
||||
// 333, and Tahoma's en space is as wide as its digits
|
||||
const width = (text: string, font: string): number => measureTextWidth(text, { font, size: 1000 });
|
||||
expect(width(" ", "Calibri Light")).to.equal(905);
|
||||
expect(width(" ", "Tahoma")).to.equal(909);
|
||||
expect(width(" ", "Tahoma")).to.equal(303);
|
||||
expect(width(" ", "Tahoma")).to.equal(546);
|
||||
// Word draws a character a font doesn't have in another font: Trebuchet MS's ∀ in Cambria Math, Gill Sans MT's
|
||||
// Cyrillic in Calibri, and Georgia's en space in Times New Roman
|
||||
expect(unknownCharacter("for ∀", { font: "Trebuchet MS" })).to.equal("∀");
|
||||
expect(unknownCharacter("Дом", { font: "Gill Sans MT" })).to.equal("Д");
|
||||
expect(unknownCharacter("a b", { font: "Georgia" })).to.equal(" ");
|
||||
expect(unknownCharacter("Дом", { font: "Verdana" })).to.equal(undefined);
|
||||
});
|
||||
|
||||
it("should make their lines as tall as Word does, from each font's hhea table (word-stops-font-heights.docx FH1 to FH16)", () => {
|
||||
// In points at 11 points, over 30 lines of each: Corbel's and Book Antiqua's are shorter than their ascent and
|
||||
// descent for Windows make them, 13.43 and 13.67 points
|
||||
for (const [font, height] of [
|
||||
["Calibri Light", 13.4234],
|
||||
["Georgia", 12.4966],
|
||||
["Corbel", 13.2828],
|
||||
["Book Antiqua", 13.2579],
|
||||
["Franklin Gothic Book", 12.4717],
|
||||
["Impact", 13.4152],
|
||||
] as const) {
|
||||
expect(measureLineHeight({ font, size: 11 }), font).to.be.closeTo(height, 0.01);
|
||||
}
|
||||
expect(measureDescent({ font: "Corbel", size: 2048 })).to.be.closeTo(525, 1e-9);
|
||||
});
|
||||
|
||||
it("should kern and join letters as Word does with Normal's settings, and put each word where Word does", () => {
|
||||
// P: the first line of prose in each font, 10 points, kerned from 1 point with standard and contextual ligatures,
|
||||
// and where Word put its last word, in points from its start: to within the half point Word's PDF puts a word to
|
||||
// across lines of 1,100 to 1,400 points, where without kerning it is up to 36 points off
|
||||
const prose =
|
||||
"“To Wyatt’s office,” Avery wrote — fifty-five affluent officials flew to Tyrone’s fjord at 7:45; Yvonne’s staff offered “efficient” coffee, attitude & difficult afflictions (Vol. VII, p. 14). L’Atelier’s AVANT-GARDE “Façade” kept 98.6% of the WAVY yellow awnings; Tom’s P.T.A. took Ty, Wa and Yo to the “Fjord-Café” for 3½ hours. “To Wyatt’s";
|
||||
const lines = [
|
||||
["Calibri Light", 341, 1275.98],
|
||||
["Aptos", 315, 1222.14],
|
||||
["Aptos Narrow", 315, 1124.96],
|
||||
["Georgia", 329, 1392.33],
|
||||
["Trebuchet MS", 315, 1353.84],
|
||||
["Century Gothic", 315, 1397.16],
|
||||
["Consolas", 224, 1187.58],
|
||||
["Candara", 341, 1358.06],
|
||||
["Corbel", 341, 1312.62],
|
||||
["Constantia", 315, 1241.02],
|
||||
["Book Antiqua", 329, 1416.2],
|
||||
["Gill Sans MT", 315, 1216.13],
|
||||
["Franklin Gothic Book", 315, 1215.73],
|
||||
["Tahoma", 315, 1307.45],
|
||||
["Impact", 315, 1149.44],
|
||||
] as const;
|
||||
for (const [font, length, last] of lines) {
|
||||
const line = [...prose].slice(0, length).join("");
|
||||
const normal = { font, size: 10, kerning: 1, ligatures: "standardContextual" } as const;
|
||||
expect(unknownShaping(line, normal), font).to.equal(undefined);
|
||||
// Where the last word starts: the text before it, and its first character, less that character's width
|
||||
const at = line.lastIndexOf(" ") + 1;
|
||||
const start = measureTextWidthAsDrawn(line.slice(0, at + 1), normal) - measureTextWidthAsDrawn(line[at], normal);
|
||||
expect(start, font).to.be.closeTo(last, 0.45);
|
||||
}
|
||||
});
|
||||
|
||||
it("should leave text with ligatures without kerning in a face whose kerning is only in its file's kern table, as Word does", () => {
|
||||
// K and P: Word kerns Trebuchet MS's To, 125 thousandths of an em nearer, without ligatures, and not with them
|
||||
const font = { font: "Trebuchet MS", size: 1000 };
|
||||
const plain = measureTextWidth("To", font);
|
||||
expect(measureTextWidthAsDrawn("To", { ...font, kerning: 1 })).to.equal(plain - 125);
|
||||
expect(measureTextWidthAsDrawn("To", { ...font, kerning: 1, ligatures: "standardContextual" })).to.equal(plain);
|
||||
// Word's PDFs showed only Normal's ligatures with it
|
||||
expect(unknownShaping("To", { ...font, kerning: 1, ligatures: "all" })).to.equal("ligatures of a setting not yet followed");
|
||||
expect(unknownShaping("To", { ...font, ligatures: "all" })).to.equal(undefined);
|
||||
// Calibri Light's kerning is in its GPOS table too, so Word kerns it with ligatures, as Calibri's
|
||||
const light = { font: "Calibri Light", size: 1000, kerning: 1 };
|
||||
expect(measureTextWidthAsDrawn("To", { ...light, ligatures: "standardContextual" })).to.equal(measureTextWidthAsDrawn("To", light));
|
||||
expect(measureTextWidthAsDrawn("To", light)).to.be.lessThan(measureTextWidth("To", light));
|
||||
});
|
||||
|
||||
it("should kern an italic Word slants as the upright face, and not know the kerning of a bold Word makes", () => {
|
||||
const kerned = (font: string, bold: boolean, italic: boolean): number =>
|
||||
measureTextWidthAsDrawn("To", { font, bold, italic, size: 1000, kerning: 1 });
|
||||
expect(kerned("Tahoma", false, true)).to.equal(kerned("Tahoma", false, false));
|
||||
expect(kerned("Trebuchet MS", true, true)).to.equal(kerned("Trebuchet MS", true, false));
|
||||
expect(unknownShaping("To", { font: "Calibri Light", bold: true, kerning: 1 })).to.equal(
|
||||
"kerned text in a font whose kerning isn't known",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -249,11 +249,11 @@ const SAME_WIDTHS: readonly (readonly [RegExp, string])[] = [
|
||||
];
|
||||
|
||||
// Fonts that are measured with a font in the table because they are close to it, which is a guess: Word draws them with
|
||||
// their own widths, such as Calibri Light 1.4% narrower than Calibri and Georgia 9% wider than Times New Roman (TX18)
|
||||
// their own widths, as it draws Calibri Light 1.4% narrower than Calibri and Georgia 9% wider than Times New Roman (TX18)
|
||||
const SIMILAR_FONTS: readonly (readonly [RegExp, string])[] = [
|
||||
[/^(calibri light|segoe ui|candara|corbel)$/i, "Calibri"],
|
||||
[/mono|courier|consolas|code|typewriter/i, "Courier New"],
|
||||
[/times|georgia|garamond|palatino|book antiqua|(?<!sans[ -]?)serif|roman/i, "Times New Roman"],
|
||||
[/^segoe ui$/i, "Calibri"],
|
||||
[/mono|courier|code|typewriter/i, "Courier New"],
|
||||
[/times|garamond|palatino|(?<!sans[ -]?)serif|roman/i, "Times New Roman"],
|
||||
];
|
||||
|
||||
// The characters of the tables, in their order, and the index of each
|
||||
@@ -395,17 +395,30 @@ const exactWidthsOf = (font: string): FontWidths | undefined => {
|
||||
|
||||
/**
|
||||
* The widths to measure a font with: its own, or those of the most similar font in the table.
|
||||
* Sans-serif fonts that aren't in the table, such as Aptos, are measured as Arial.
|
||||
* Sans-serif fonts that aren't in the table, such as Roboto, are measured as Arial.
|
||||
*/
|
||||
const widthsOf = (font = DEFAULT_FONT): FontWidths => {
|
||||
const similar = SIMILAR_FONTS.find(([pattern]) => pattern.test(font));
|
||||
return exactWidthsOf(font) ?? named(similar ? similar[1] : "Arial")!;
|
||||
};
|
||||
|
||||
/** The widths of the face text is in: its font's, bold, italic, both or neither */
|
||||
const faceOf = ({ font, bold, italic }: TextFont): readonly (number | undefined)[] => {
|
||||
/**
|
||||
* The widths of a font's face, as the table writes them, or undefined for bold in a font without a bold face, such as
|
||||
* Calibri Light, which Word makes itself, drawing each character 18 thousandths of an em wider than the face it makes it
|
||||
* from at 10 points (`word-stops-font-widths.docx`). Italic in a font without an italic face, such as Tahoma, is the
|
||||
* upright face's, as Word slants it, as wide (`word-stops-font-italic-widths.docx`), and so is Trebuchet MS's bold italic,
|
||||
* which Word draws as its bold, slanted
|
||||
*/
|
||||
const encodedFaceOf = (widths: FontWidths, bold: boolean, italic: boolean): string | undefined =>
|
||||
bold ? (italic ? (widths.boldItalic ?? widths.bold) : widths.bold) : italic ? (widths.italic ?? widths.regular) : widths.regular;
|
||||
|
||||
/**
|
||||
* The widths of the face text is in: its font's, bold, italic, both or neither. Bold that Word makes itself, which
|
||||
* {@link unknownFont} says, is measured as the face Word makes it from
|
||||
*/
|
||||
const faceOf = ({ font, bold = false, italic = false }: TextFont): readonly (number | undefined)[] => {
|
||||
const widths = widthsOf(font);
|
||||
return decodeWidths(italic ? (bold ? widths.boldItalic : widths.italic) : bold ? widths.bold : widths.regular);
|
||||
return decodeWidths(encodedFaceOf(widths, bold, italic) ?? encodedFaceOf(widths, false, italic)!);
|
||||
};
|
||||
|
||||
// Characters as wide as they are tall: Chinese, Japanese and Korean, full-width forms and emoji
|
||||
@@ -507,18 +520,21 @@ export const unknownCharacter = (text: string, font: TextFont = {}): string | un
|
||||
|
||||
/**
|
||||
* Whether the tables measure text in a font as another font, as they don't have the font's own widths: a font that isn't
|
||||
* in them and isn't made with the same widths as one that is, such as Aptos, which they measure as the most similar
|
||||
* in them and isn't made with the same widths as one that is, such as Roboto, which they measure as the most similar
|
||||
* font that is. Word draws it with its own widths when it has it, and in another font when it doesn't, such as Cambria
|
||||
* on the Mac (`word-watertight-text.docx` TX18), so a layout stops there rather than guessing. The East Asian fonts of
|
||||
* the tables are measured as themselves, but for the other characters of those that aren't monospaced, such as Latin
|
||||
* letters in Yu Gothic, which are measured as Times New Roman or Arial. Without text, whether the height of a line in
|
||||
* the font is another font's.
|
||||
* on the Mac (`word-watertight-text.docx` TX18), so a layout stops there rather than guessing. Bold in a font of the
|
||||
* tables without a bold face, such as Calibri Light, Franklin Gothic Book and Impact, is one too: Word makes it itself,
|
||||
* each character wider than the face it makes it from, by 18 thousandths of an em at 10 points
|
||||
* (`word-stops-font-widths.docx`), which other sizes haven't shown. The East Asian fonts of the tables are measured as
|
||||
* themselves, but for the other characters of those that aren't monospaced, such as Latin letters in Yu Gothic, which
|
||||
* are measured as Times New Roman or Arial. Without text, whether the height of a line in the font is another font's.
|
||||
*/
|
||||
export const unknownFont = (font: TextFont = {}, text?: string): boolean => {
|
||||
const name = font.font ?? DEFAULT_FONT;
|
||||
const eastAsian = knownEastAsianFontOf(name);
|
||||
if (eastAsian === undefined) {
|
||||
return exactWidthsOf(name) === undefined;
|
||||
const widths = exactWidthsOf(name);
|
||||
return widths === undefined || encodedFaceOf(widths, font.bold === true, font.italic === true) === undefined;
|
||||
}
|
||||
return (
|
||||
!eastAsian.monospaced &&
|
||||
@@ -568,7 +584,7 @@ export const measureTextWidthAsDrawn = (text: string, font: TextFont = {}, start
|
||||
const widthOf = (character: string): number => characterWidth(widths, character);
|
||||
const size = sizeOf(font);
|
||||
const { characterSpacing = 0, scale = 100 } = font;
|
||||
const kerned = isKerned(font);
|
||||
const kerned = kernedIn(font, shaping);
|
||||
return (
|
||||
text.split("\t").reduce((position, part, index) => {
|
||||
const at = index === 0 ? position : (Math.floor(position / TAB_STOP) + 1) * TAB_STOP;
|
||||
@@ -597,6 +613,14 @@ const shapingFor = (font: TextFont): FaceShaping | undefined =>
|
||||
? shapingOf(named(font.font ?? DEFAULT_FONT)?.name ?? "", font.bold === true, font.italic === true)
|
||||
: undefined;
|
||||
|
||||
/**
|
||||
* Whether Word kerns text: when it asks for kerning, but for text with ligatures in a face whose kerning is only in its
|
||||
* font's kern table, such as Trebuchet MS's, which Word kerns without ligatures and not with them
|
||||
* (scripts/layout-probes/stops2/word-stops-font-kerning.ts K and P)
|
||||
*/
|
||||
const kernedIn = (font: TextFont, shaping: FaceShaping): boolean =>
|
||||
isKerned(font) && !(hasLigatures(font) && shaping.notKernedWithLigatures);
|
||||
|
||||
/** The glyphs text is drawn in: its characters, joined into ligatures as its font's rules join them */
|
||||
const glyphsOf = (text: string, font: TextFont, shaping: FaceShaping | undefined): readonly Glyph[] => {
|
||||
const rules = shaping !== undefined && hasLigatures(font) ? rulesOf(shaping, font.ligatures!) : undefined;
|
||||
@@ -611,16 +635,21 @@ const LETTERS = /\p{L}\p{L}/u;
|
||||
* kerning they don't have, or with a character whose kerning they don't have, and ligatures in a font or of a setting
|
||||
* whose ligatures they don't have, or beside a character they haven't seen them beside. The tables have Word's kerning of
|
||||
* the characters of Windows-1252, and its ligatures of Word's settings, in the fonts of the tables, but for those of East
|
||||
* Asian fonts (scripts/layout-probes/word-kerning.ts). Courier New, of which Word kerned no pair of printable ASCII, and
|
||||
* monospaced East Asian fonts, aren't kerned.
|
||||
* Asian fonts (scripts/layout-probes/word-kerning.ts), and in Office's other fonts in the tables
|
||||
* (scripts/layout-probes/stops2/word-stops-font-kerning.ts). Courier New, of which Word kerned no pair of printable ASCII,
|
||||
* and monospaced East Asian fonts, aren't kerned, and nor is text with ligatures in a face Word kerns only without them,
|
||||
* which Word's PDF showed with Normal's ligatures, standard and contextual, and no others.
|
||||
*/
|
||||
export const unknownShaping = (text: string, font: TextFont = {}): string | undefined => {
|
||||
const kerned = isKerned(font);
|
||||
const ligatures = hasLigatures(font);
|
||||
if ((!kerned && !ligatures) || eastAsianFontOf(font.font ?? DEFAULT_FONT)?.monospaced === true) {
|
||||
if ((!isKerned(font) && !ligatures) || eastAsianFontOf(font.font ?? DEFAULT_FONT)?.monospaced === true) {
|
||||
return undefined;
|
||||
}
|
||||
const shaping = shapingFor(font);
|
||||
if (isKerned(font) && ligatures && shaping?.notKernedWithLigatures === true && font.ligatures !== "standardContextual") {
|
||||
return "ligatures of a setting not yet followed";
|
||||
}
|
||||
const kerned = shaping === undefined ? isKerned(font) : kernedIn(font, shaping);
|
||||
// The parts between tabs, which are measured apart, so nothing is kerned or joined across a tab. Characters that take
|
||||
// no room, such as a zero-width space or a combining mark, are measured as characters of their own, whose kerning,
|
||||
// and whether Word kerns and joins the letters beside them across them, isn't known
|
||||
|
||||
Reference in New Issue
Block a user