hb-ot-metrics: HarfBuzz Manual

## hb-ot-metrics

hb-ot-metrics — OpenType Metrics

## Functions

hb_bool_t | hb_ot_metrics_get_position ()
void | hb_ot_metrics_get_position_with_fallback ()
float | hb_ot_metrics_get_variation ()
hb_position_t | hb_ot_metrics_get_x_variation ()
hb_position_t | hb_ot_metrics_get_y_variation ()

## Types and Values

enum | hb_ot_metrics_tag_t

## Includes

    #include <hb-ot.h>

## Description

Functions for fetching metrics from fonts.

## Functions

### hb_ot_metrics_get_position ()

    hb_bool_t
    hb_ot_metrics_get_position (hb_font_t *font,
                                hb_ot_metrics_tag_t metrics_tag,
                                hb_position_t *position);

Fetches metrics value corresponding to `metrics_tag` from `font` .

#### Parameters

font | an hb_font_t object. |
metrics_tag | tag of metrics value you like to fetch. |
position | result of metrics value from the font. | [out][optional]

#### Returns

Whether found the requested metrics in the font.

Since: 2.6.0

### hb_ot_metrics_get_position_with_fallback ()

    void
    hb_ot_metrics_get_position_with_fallback
                                   (hb_font_t *font,
                                    hb_ot_metrics_tag_t metrics_tag,
                                    hb_position_t *position);

Fetches metrics value corresponding to `metrics_tag` from `font` , and synthesizes a value if it the value is missing in the font.

#### Parameters

font | an hb_font_t object. |
metrics_tag | tag of metrics value you like to fetch. |
position | result of metrics value from the font. | [out][optional]

Since: 4.0.0

### hb_ot_metrics_get_variation ()

    float
    hb_ot_metrics_get_variation (hb_font_t *font,
                                 hb_ot_metrics_tag_t metrics_tag);

Fetches metrics value corresponding to `metrics_tag` from `font` with the current font variation settings applied.

#### Parameters

font | an hb_font_t object. |
metrics_tag | tag of metrics value you like to fetch. |

#### Returns

The requested metric value.

Since: 2.6.0

### hb_ot_metrics_get_x_variation ()

    hb_position_t
    hb_ot_metrics_get_x_variation (hb_font_t *font,
                                   hb_ot_metrics_tag_t metrics_tag);

Fetches horizontal metrics value corresponding to `metrics_tag` from `font` with the current font variation settings applied.

#### Parameters

font | an hb_font_t object. |
metrics_tag | tag of metrics value you like to fetch. |

#### Returns

The requested metric value.

Since: 2.6.0

### hb_ot_metrics_get_y_variation ()

    hb_position_t
    hb_ot_metrics_get_y_variation (hb_font_t *font,
                                   hb_ot_metrics_tag_t metrics_tag);

Fetches vertical metrics value corresponding to `metrics_tag` from `font` with the current font variation settings applied.

#### Parameters

font | an hb_font_t object. |
metrics_tag | tag of metrics value you like to fetch. |

#### Returns

The requested metric value.

Since: 2.6.0

## Types and Values

### enum hb_ot_metrics_tag_t

Metric tags corresponding to MVAR Value Tags

#### Members

HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER | horizontal ascender. |
HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER | horizontal descender. |
HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP | horizontal line gap. |
HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT | horizontal clipping ascent. |
HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT | horizontal clipping descent. |
HB_OT_METRICS_TAG_VERTICAL_ASCENDER | vertical ascender. |
HB_OT_METRICS_TAG_VERTICAL_DESCENDER | vertical descender. |
HB_OT_METRICS_TAG_VERTICAL_LINE_GAP | vertical line gap. |
HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE | horizontal caret rise. |
HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN | horizontal caret run. |
HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET | horizontal caret offset. |
HB_OT_METRICS_TAG_VERTICAL_CARET_RISE | vertical caret rise. |
HB_OT_METRICS_TAG_VERTICAL_CARET_RUN | vertical caret run. |
HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET | vertical caret offset. |
HB_OT_METRICS_TAG_X_HEIGHT | x height. |
HB_OT_METRICS_TAG_CAP_HEIGHT | cap height. |
HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_SIZE | subscript em x size. |
HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_SIZE | subscript em y size. |
HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_OFFSET | subscript em x offset. |
HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_OFFSET | subscript em y offset. |
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_SIZE | superscript em x size. |
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_SIZE | superscript em y size. |
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET | superscript em x offset. |
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET | superscript em y offset. |
HB_OT_METRICS_TAG_STRIKEOUT_SIZE | strikeout size. |
HB_OT_METRICS_TAG_STRIKEOUT_OFFSET | strikeout offset. |
HB_OT_METRICS_TAG_UNDERLINE_SIZE | underline size. |
HB_OT_METRICS_TAG_UNDERLINE_OFFSET | underline offset. |

Since: 2.6.0