Skip to content

Freetype2: Assuming that glyph height is font height is wrong. #928

Open
@Glandos

Description

@Glandos
System information (version)
  • OpenCV => 3.2
  • Operating System / Platform => Linux
  • Compiler => ❔
Detailed description

Currently on this line, the code assumes that the font height will be the maximum height of a glyph. This is wrong, especially with diacritics.

The code cannot really cover all Unicode insanities (see http://stackoverflow.com/questions/10414864/whats-up-with-these-unicode-combining-characters-and-how-can-we-filter-them), but even some basic characters can have some higher metrics, either above or below the base height. I don't know if FreeType2 can extract this information from a complete font file, or only glyph by glyph.

As an example cairo provides a height attributes that is a good hint. It seems that this value is set from FT_Face.size->metrics

This is obviously an open discussion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions