Repository navigation
fix(android): fetch desktop-installed fonts the scene uses - #1271
Merged
Merged
Conversation
…the phone - Font list with 1,098 faces (Windows fonts plus two renamed copies): first read 337-344 ms, from the cache file 151-162 ms, longest stall 2 ms. - A video clip with its sound on, 600 s in the panel: audio minus video median 33 ms, max 64 ms; no growth over time and no re-seeks. - Desktop and emulator paired: the phone fetched a missing library font in 1.07 s with identical bytes and both axes. For #1175 #1176 Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
docs(bench): 1,098 system fonts, 10-minute clip A/V gap, PC fonts on the phone
Text whose font was picked from the System group has only a CSS family
and no fontId. The link moved library fonts only, and the engine
registered faces only through fontId, so the phone showed the family as
selected but drew the fallback stack.
- font.list takes { families } and adds the installed faces of those
families that the library lacks. Ids are sys-<sha1 of path>; only
.ttf/.otf, and faces whose OS/2 fsType marks a restricted license are
left out. Only listed ids are read; no path leaves the desktop.
- The system font scan keeps fsType and axes (cache v2) and the file
path for the main process; the panel IPC strips the path.
- font-runtime registers the faces of every family named first in a
font value, not only those reached through fontId. The fallback stack
and generic families are ignored.
For #1176
Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
…phone-pc-font # Conflicts: # README.md # README.tr.md # ROADMAP.md
fix(fonts): send desktop-installed fonts to the phone over the link
Text whose font was picked from the desktop's System group has only a
CSS family and no fontId, so the phone never asked for it and drew the
fallback stack while the inspector showed the family as selected.
syncFonts now also takes the first family of every font value in the
drawn settings (FR.usedFamilies, from main), and for families missing
from the phone's font library calls font.list { families }. Matching
faces are fetched like library faces. A family the desktop does not
offer (not installed, or a restricted license) is not asked again.
An older desktop ignores the argument.
For #1176
Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #1176
Reported: a font installed on the PC is selected for a text layer; the phone shows it as selected but does not apply it. The font was CaYa Font, installed in the Windows per-user font folder and picked from the System group, so the settings have
font: "\"CaYa Font\", system-ui, …"and nofontId. The phone only fetched fonts byfontId.font.list { families }, engine registers faces by family) and docs(bench): 1,098 system fonts, 10-minute clip A/V gap, PC fonts on the phone #1268 (docs).syncFonts(src/mobile/android-host.js): the first family of everyfontvalue in the drawn settings (FR.usedFamilies) that the phone's font library lacks is requested withfont.list { families }(at most 16), and the faces are fetched like library faces. The fallback stack (Segoe UI, Roboto…) is never asked for. A family the desktop does not offer (not installed, restricted license) is not asked again. An older desktop ignores the argument.Checked on the emulator against a desktop built from this branch (isolated profile, the real installed CaYa-Font.otf read, nothing installed): 8/8
"CaYa Font"and no id: the face arrived in 1.06 s, SHA-256 identical to the PC file (49,680 bytes);CaYa Fontloaded,document.fonts.checktrue, measured text width differs from the fallback (754 vs 706 px);npm test 4947 pass, 1 skipped (count docs 4948); phone JS tests 162/162.