-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable fonts #495
Comments
In CSS you need to register a new variable font with However, the variable axis can be controlled directly through the low-level property As far as I know, skr-canvas does not currently support variable fonts. The primary goal in skr-canvas should be to find an implementation that corresponds to font-variation-setting in order to control the variable axis. Here is some information for reference. |
As far as I know, there is no other canvas library in Node.js that supports variable fonts except @Brooooooklyn Can this be our goal for 2024? canvaskit-wasm/types/index.d.ts export interface TextStyle {
backgroundColor?: InputColor
color?: InputColor
decoration?: number
decorationColor?: InputColor
decorationThickness?: number
decorationStyle?: DecorationStyle
fontFamilies?: string[]
fontFeatures?: TextFontFeatures[]
fontSize?: number
fontStyle?: FontStyle
fontVariations?: TextFontVariations[]
foregroundColor?: InputColor
heightMultiplier?: number
halfLeading?: boolean
letterSpacing?: number
locale?: string
shadows?: TextShadow[]
textBaseline?: TextBaseline
wordSpacing?: number
}
export interface TextFontFeatures {
name: string
value: number
}
export interface TextFontVariations {
axis: string
value: number
} |
How can I register and use a variable font?
If I register
and try to render different font weights (100–900) by something like:
I get the following result:
Weights 100–500 are rendered at 400, and 600–900 are rendered at 700.
I would expect to see an even gradient from 100–700 as the weight specified in
ctx.font
changes.The text was updated successfully, but these errors were encountered: