View on GitHub

Font-FreeType-raku

Read font files and render glyphs using FreeType2

[Raku PDF Project] / [Font-FreeType Module] / Font::FreeType :: Raw :: TT_Sfnt

module Font::FreeType::Raw::TT_Sfnt

Direct access to TrueType (Sfnt) records

Example

use Font::FreeType;
use Font::FreeType::Raw::TT_Sfnt;
my  Font::FreeType $freetype .= new;
my $face = $freetype.face: "t/fonts/Vera.ttf";
# Get some metrics from the font's PCLT table, if available
my TT_PCLT $pclt .= load: :$face;
my $x-height   = .xHeight with $pclt;
my $cap-height = .capHeight with $pclt;

Description

This module maps to FreeType functions that directly expose the data in the following TrueType/OpenType Sfnt tables.

Code Class Description Accessors
head TT_Header The head table for a TTF Font checkSumAdjustment flags fontDirectionHint fontRevision glyphDataFormat indexToLocFormat lowestRecPPEM macStyle magicNumber unitsPerEm version xMax xMin yMax yMin
vhea TT_VertHeader Vertical Header table advanceHeightMax ascent caretOffset caretSlopeRise caretSlopeRun descent lineGap metricDataFormat minBottomSideBearing minTopSideBearing numOfLongVerMetrics version yMaxExtent
hhea TT_HoriHeader Horizontal Header table advanceWidthMax ascent caretOffset caretSlopeRise caretSlopeRun descent lineGap metricDataFormat minLeftSideBearing minRightSideBearing numOfLongHorMetrics version xMaxExtent
maxp TT_MaxProfile Maximum Profile table maxComponentDepth maxComponentElements maxCompositeContours maxCompositePoints maxContours maxFunctionDefs maxInstructionDefs maxPoints maxSizeOfInstructions maxStackElements maxStorage maxTwilightPoints maxZones numGlyphs version
post TT_Postscript Postscript properties format italicAngle underlinePosition underlineThickness isFixedPitch minMemType42 maxMemType42 minMemType1 maxMemType1
OS/2 TT_OS2 OS2 Specific property table achVendID fsSelection fsType panose sCapHeight sFamilyClass sTypoAscender sTypoDescender sTypoLineGap sxHeight ulCodePageRange1 ulCodePageRange2 ulUnicodeRange1 ulUnicodeRange2 ulUnicodeRange3 ulUnicodeRange4 usBreakChar usDefaultChar usFirstCharIndex usLastCharIndex usLowerPointSize usMaxContext usUpperPointSize usWeightClass usWidthClass usWinAscent usWinDescent version xAvgCharWidth yStrikeoutPosition yStrikeoutSize ySubscriptXOffset ySubscriptXSize ySubscriptYOffset ySubscriptYSize ySuperscriptXOffset ySuperscriptXSize ySuperscriptYOffset ySuperscriptYSize
PCLT TT_PCLT PCLT Specific property table capHeight characterComplement fileName fontNumber pitch reserved serifStyle strokeWeight style symbolSet typeFace typeFamily version widthType xHeight