UnreviewedUnreviewedshorthandCSS font shorthand, assembled here because every engine returns an empty
string for the computed shorthand. stretch and variantCaps are left out
of it deliberately: a percentage font-stretch makes every engine reject
the whole string and fall back to 10px sans-serif. Apply those through
ctx.fontStretch / ctx.fontVariantCaps after setting ctx.font.
UnreviewedfamilyResolved family list, quoted as the engine reports it.
UnreviewedsizeFont size in CSS pixels.
UnreviewedweightNumeric weight, 1-1000.
Unreviewedstylenormal, italic, or an oblique <angle>.
UnreviewedstretchComputed font-stretch, a percentage such as 88%. Canvas: ctx.fontStretch.
UnreviewedlineLine height in CSS pixels, or null when it computes to normal. Canvas
ignores line height in ctx.font; this is for laying text out yourself.
UnreviewedletterA length, never normal - normal is reported as 0px, which is what
ctx.letterSpacing accepts.
UnreviewedwordSame normalization as letterSpacing. Canvas: ctx.wordSpacing.
UnreviewedcolorResolved text color. Canvas: ctx.fillStyle.
UnreviewedfeatureCanvas 2D consumes neither of these. They are here for text you measure or draw some other way.
UnreviewedkerningCanvas: ctx.fontKerning.
UnreviewedvariantCanvas: ctx.fontVariantCaps.
UnreviewedtextCanvas: ctx.textRendering, which WebKit does not implement.
UnrevieweddirectionCanvas: ctx.direction.
The box's resolved text style, shaped to configure a canvas 2D context.
Assign
shorthandtoctx.fontfirst: Chromium and Firefox resetfontStretch,fontVariantCaps,fontKerningandtextRenderingwhenfontis assigned, so setting those before it loses them.