Documentation/GdiFont
classWORKERCLONEABLE

GdiFont

js/foo_uie_jsplitter.js:6604
GdiFont(name, size_px, style)

Constructor may fail if font is not present.

Performance note: try caching and reusing GdiFont objects, since the maximum amount of such objects is hard-limited by Windows. GdiFont creation will fail after reaching this limit.

Parameters

NameTypeDescription
namestring
size_pxnumber

See Point2Pixel function for conversions

style = 0optionalnumber

See FontStyle flags

propertyWORKERreadonly

Height

js/foo_uie_jsplitter.js:6618
Height: number

Example

console.log(my_font.Height); // 15
propertyWORKERreadonly

Name

js/foo_uie_jsplitter.js:6628
Name: string

Example

console.log(my_font.Name); // Segoe UI
propertyWORKERreadonly

Size

js/foo_uie_jsplitter.js:6638
Size: float

Example

console.log(my_font.Size); // 12
propertyWORKERreadonly

Style

js/foo_uie_jsplitter.js:6648
Style: number

See FontStyle flags for value interpretation.

Example

console.log(my_font.Style);
propertyWORKERreadonly

Weight

js/foo_uie_jsplitter.js:6660
Weight: number

Font weight. Common values follow Win32 font weights, for example 400 for normal and 700 for bold.