Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change allows TTF_Fonts to be created with DPI resolutions other than FreeType's default 72 DPI. Doing so allows fonts to be scaled linearly (at runtime), whereas point-sizes often do not scale linearly. New functions added to SDL_ttf to facilitate this change: TTF_OpenFontDPI TTF_OpenFontIndexDPI TTF_OpenFontDPIRW TTF_OpenFontIndexDPIRW TTF_SetFontSizeDPI To each DPI-enabled call are added two parameters at the end: 1. unsigned int hdpi: specifies the DPI resolution along the horizontal axis 2. unsigned int vdpi: specifies the DPI resolution along the vertical axis Both parameters are passed directly into FreeType, which processes them as such: * if both hdpi and vdpi are 0, then FreeType will use its default DPI of 72 * if only hdpi, or only vdpi, is 0, then FreeType will use the non-zero value for both hdpi and vdpi. For example, if hdpi is 0 and vdpi is 144, FreeType will use 144 DPI on both axes. * if both hdpi and vdpi are NOT 0, then FreeType will use the DPI resolutions as specified, along their respective axes. This addition requires no modifications to FreeType 2.x itself, and does not modify any existing SDL_ttf API (for source and binary level compatibility).
- Loading branch information
1 parent
d2cfe8c
commit 593fb06
Showing
2 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters