class Hpdf::Font
- Hpdf::Font
- Reference
- Object
Included Modules
Defined in:
hpdf/font.crConstructors
Instance Method Summary
-
#ascent(font_size : Number) : Float32
the vertical ascent of the font in points calculated based on the given font_size.
-
#ascent : Int32
the vertical ascent of the font in UPM (units per eM).
-
#b_box : Rectangle
the bounding box of the font.
-
#cap_height(font_size : Number) : Float32
the distance from the baseline of uppercase letters in points calculated based on the given font_size.
-
#cap_height : UInt32
the distance from the baseline of uppercase letters in UPM (units per eM).
-
#descent(font_size : Number) : Float32
the vertical descent of the font in points calculated based on the given font_size.
-
#descent : Int32
the vertical descent of the font in UPM (units per eM).
-
#encoding_name : String
the encoding name of the font.
-
#measure_text(text : String | Bytes, *, width : Number, font_size : Number, char_space : Number, word_space : Number, word_wrap : Bool = true) : MeasuredText
calculates the byte length which can be included within the specified width.
-
#name : String
the name of the font.
-
#text_width(text : String | Bytes)
total width of the text, number of charactors and number of the words.
- #to_unsafe : LibHaru::Font
-
#unicode_width(char : UInt16) : Int32
the width of a charactor in the font.
-
#x_height(font_size : Number) : Float32
the distance from the baseline of lowercase letters in points calculated based on the given font_size.
-
#x_height : UInt32
the distance from the baseline of lowercase letters in UPM (units per eM).
Instance methods inherited from module Hpdf::Helper
bool(val : Bool) : Int32
bool,
nilable_str(v : Pointer(UInt8)) : String | Nil
nilable_str,
real(val : Number) : LibHaru::Real
real,
uint(val : Number) : LibHaru::UInt
uint,
uint16(val : Number) : UInt16
uint16
Constructor Detail
Instance Method Detail
the vertical ascent of the font in points calculated based on the given font_size.
- font_size the size to calculate the height with.
the distance from the baseline of uppercase letters in points calculated based on the given font_size.
- font_size the size to calculate the height with.
the distance from the baseline of uppercase letters in UPM (units per eM).
the vertical descent of the font in points calculated based on the given font_size.
- font_size the size to calculate the height with.
calculates the byte length which can be included within the specified width.
- width The width of the area to put the text.
- font_size The size of the font.
- char_space The character spacing.
- word_space The word spacing.
- word_wrap When there are three words of
"ABCDE FGH IJKL"
, and the substring until"J"
can be included within the width, if word_wrap parameter isfalse
it returns12
, and if word_wrap parameter isfalse
word_wrap parameter isfalse
it returns10
(the end of the previous word).
total width of the text, number of charactors and number of the words.
the distance from the baseline of lowercase letters in points calculated based on the given font_size.
- font_size the size to calculate the height with.