CoreFont
[Raku PDF Project] / [PDF-Content Module] / PDF::Content :: Font :: CoreFont
class PDF::Content::Font::CoreFont
Basic PDF core font support
Synopsis
use PDF::Content::Font::CoreFont;
my PDF::Content::Font::CoreFont $font .= load-font( :family<Times-Roman>, :weight<bold> );
say $font.encode("ΒΆHi");
say $font.stringwidth("RVX"); # 2166
say $font.stringwidth("RVX", :kern); # 2111Methods
multi method height
multi method height(
Numeric $pointsize = 1000,
Bool :$ex! where { ... }
) returns Numericget the height of 'X' for the font
multi method height
multi method height(
Numeric $pointsize = 1000,
Bool :$from-baseline,
Bool :$hanging
) returns Numericcompute the overall font-height
method stringwidth
method stringwidth(
Str $str,
$pointsize = 0,
Bool :$kern = Bool::False
) returns Numericcompute the width of a string
method encoding
method encoding() returns StrCore font base encoding: WinAnsi, MacRoman or MacExpert
method to-dict
method to-dict() returns PDF::COS::Dictproduce a PDF Font dictionary for this core font
method font-name
method font-name() returns Strreturn the font name
method underline-position
method underline-position() returns Numericreturn the underline position for the font
method underline-thickness
method underline-thickness() returns Numericreturn the underline thickness for the font
method type
method type() returns StrPDF Font type (always 'Type1' for core fonts)
method is-embedded
method is-embedded() returns Boolwhether font is embedded (always False for core fonts)
method is-subset
method is-subset() returns Boolwhether font is subset (always False for core fonts)
method is-core-font
method is-core-font() returns Boolwhether font is a core font (always True for core fonts)
method cb-finish
method cb-finish() returns PDF::COS::Dictfinish a PDF rendered font