Skip to content

Font Handling #4

@oclyke

Description

@oclyke

How Should HyperDisplay Support Fonts?

This is intended to be a discussion about how HyperDisplay should support fonts, prompted by issue #2 and PR #3.

HyperDisplay Philosophy

Above all else the solution to font handling in HD should not conflict with the design philosophy. The primary concerns of HD are:

  • Portability
  • Independence (decoupled)
  • General
  • Extensible

Portability
HyperDisplay shall be written in standard C++ that can be easily ported and compiled on the majority of build systems. It shall make no special accommodations for particular host platforms within the source code (however it may provide the extensible ability to do so in a platform-agnostic way)

Independence
HyperDisplay shall be decoupled from other problem spaces. The intent is first and foremost to provide a suite of common graphical functions with great portability and extensibility. An exceptionally strong argument must be made for including any additional / extraneous features such as user input handling or image processing. The other side of that coin is that HD should be designed to easily interface with other libraries that do handle those functionalities.

Generality
Within reasonable limits HyperDisplay shall provide the most general solution to the problem. It is acceptable to provide a specialized capability as a subset of a generalized capability. For example a monochrome line with a fixed width is a specialized form of a general line. The generalized line, with color sequence and width options, is the preferred solution.

Extensibility
Tightly related to generality -- HyperDisplay shall be easy to extend by pairing it with additional libraries and source code. Currently this is where font handling fits best into HD.

Why Support Fonts?

Fonts are sets of graphical icons that are used to display a human language on a screen. Of course the capability to display written language will be desirable in a majority of graphical projects.

Additionally users of a graphics library would rightfully expect it to be easy to show text in their language of choice. If HD were not to support fonts it would not be regarded as a functional package for most applications.

Challenges

Adding font support in a manner that aligns with the goals of HD is no easy task. For example:

  • There are nearly unlimited possibilities for what a user might expect from a font. Thousands of languages, thousands of unique styles possible at many different sizes, and even fonts that are entirely original by the user. Making concessions to any limited number of fonts violates the "portability" and "generality" philosophies - not to mention clutters up the codebase.

  • There are many possible technologies associated with fonts. One example may be the use of "avr/pgmspace" in the (one and only) default font for HD. This is not portable. Additionally there are a host of advanced features that may be desired in some fonts such as Subpixel Rendering, Font Hinting, and Typographic Ligature. According to the design intent of HD all of these should be possible but none should be required.

  • Maintenance of any library is challenging, but in order not to have preference to one font over another there must be a good way for users to share fonts that are compatible with HD. This will come with more associated work.

Open Table

Are there any interested parties that would like input on how fonts are handled in HyperDisplay? If so now is the time to speak up. Let's work together to make this great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions