Provide font on app side - breaking change#76
Open
SamuelBrucksch wants to merge 16 commits intomasterfrom
Open
Provide font on app side - breaking change#76SamuelBrucksch wants to merge 16 commits intomasterfrom
SamuelBrucksch wants to merge 16 commits intomasterfrom
Conversation
|
|
||
| class SymbolFont { | ||
| private static let defaultCanvasSize = 32 | ||
| private static var cachedFontName: String? |
Contributor
There was a problem hiding this comment.
The mutable static variable cachedFontName is not protected against concurrent access, which may lead to thread-safety issues.
Contributor
Author
There was a problem hiding this comment.
Not sure this is actually an issue...
| class SymbolFont { | ||
| private static let defaultCanvasSize = 32 | ||
| private static var cachedFontName: String? | ||
| private static var cachedPSName: String? |
Contributor
There was a problem hiding this comment.
The mutable static variable cachedPSName is not protected against concurrent access, which may lead to thread-safety issues.
Contributor
|
Minor thread-safety concerns were identified regarding the mutable global cached state in the native modules. |
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.
With this PR we remove the provided Material Symbol Font and let the app set the default font.
Setup
Add a
.ttffont file to your native projects:<name>.ttfto your app bundle (noUIAppFontsentry needed — the library registers it via CoreText automatically).<name>.ttfinres/font/.For cross-platform compatibility use lowercase names with underscores only (e.g.
material_symbols).Register the font and an optional glyph map at startup:
Use glyph images by name or code point:
setIconFontmust be called once before the first glyph is used (subsequent calls are ignored). If no font is registered, the library throws an error when a glyph image is rendered.Type-safe glyph names
To get autocompletion and type checking for glyph names, create a declaration file in your app (e.g.
autoplay-glyphs.d.ts):Without this augmentation,
nameaccepts anystring. With it, only keys from your glyph map are allowed and you get full autocompletion.