class Freetype::SizeMetrics

Overview

The size metrics structure gives the metrics of a size object.

Note

The scaling values, if relevant, are determined first during a size changing operation. The remaining fields are then set by the driver. For scalable formats, they are usually set to scaled values of the corresponding fields in Face.

Note that due to glyph hinting, these values might not be exact for certain fonts. Thus they must be treated as unreliable with an error margin of at least one pixel!

Indeed, the only way to get the exact metrics is to render all glyphs. As this would be a definite performance hit, it is up to client applications to perform such computations.

The SizeMetrics structure is valid for bitmap fonts also.

Defined in:

freetype/size_metrics.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(size_metrics : LibFreetype::FT_Size_Metrics) #

[View source]

Instance Method Detail

def ascender #

The ascender in 26.6 fractional pixels. See Face for the details.


[View source]
def descender #

The descender in 26.6 fractional pixels. See Face for the details.


[View source]
def height #

The height in 26.6 fractional pixels. See Face for the details.


[View source]
def max_advance #

The maximal advance width in 26.6 fractional pixels. See Face for the details.


[View source]
def size_metrics : LibFreetype::FT_Size_Metrics #

[View source]
def x_ppem #

The width of the scaled EM square in pixels, hence the term 'ppem' (pixels per EM). It is also referred to as 'nominal width'.


[View source]
def x_scale #

A 16.16 fractional scaling value used to convert horizontal metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.


[View source]
def y_ppem #

The height of the scaled EM square in pixels, hence the term 'ppem' (pixels per EM). It is also referred to as 'nominal height'.


[View source]
def y_scale #

A 16.16 fractional scaling value used to convert vertical metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.


[View source]