class Hpdf::Font
- Hpdf::Font
- Reference
- Object
Included Modules
Defined in:
hpdf/font.crConstructors
Instance Method Summary
-
#ascent : Int32
the vertical ascent of the font.
-
#b_box
the bounding box of the font.
-
#cap_height : UInt32
the distance from the baseline of uppercase letters.
-
#descent : Int32
the vertical descent of the font.
-
#encoding_name : String
the encoding name of the font.
-
#measure_text(text : String, *, 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)
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 : UInt32
the distance from the baseline of lowercase letters.
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
def measure_text(text : String, *, 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.
- 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).
def text_width(text : String)
#
total width of the text, number of charactors and number of the words.