Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Allow specifying multiple fonts or font families for local font rendering #16253

Merged
merged 11 commits into from
Apr 24, 2020

Commits on Apr 24, 2020

  1. [ios, macos] Corrected PingFang test fixture

    PingFangTC-Regular is better than PingFangTC-Thin. There is no font by the name “PingFang”.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    944e034 View commit details
    Browse the repository at this point in the history
  2. [ios, macos] Allow specifying multiple fonts or font families for loc…

    …al font rendering
    
    mbgl::Renderer and mbgl::MapSnapshotter can now contain a list of font family names, font display names, and font PostScript names, each name separated by a newline.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    61e4f46 View commit details
    Browse the repository at this point in the history
  3. [ios, macos] Take font family names from user defaults

    Take font family names from user defaults before falling back to font family names in Info.plist.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    b830eb2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fc31f77 View commit details
    Browse the repository at this point in the history
  5. [ios, macos] Choose fonts from font stack that match local fonts

    Prefer local fonts that match the names specified in the font stack (from the text-font layout property), except for the last resort fonts that mbgl hard-codes. Fall back to the list of fallback CJK fonts in user defaults, then the fonts passed in through the platform-agnostic interface (that come from Info.plist). Explicitly use the first font descriptor in the cascade list instead of the system default of Helvetica.
    
    Since the font stack can vary from one rasterization operation to the next, avoid caching the resolved font for now. Removed null checks that are unrealistic given the Core Text API contract.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    bc468c3 View commit details
    Browse the repository at this point in the history
  6. [ios, macos] Avoid redundant fallback in font cascade list

    A font descriptor should not be a fallback for itself.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    4b67fb1 View commit details
    Browse the repository at this point in the history
  7. [ios, macos] Get glyph metrics from font

    Get glyph metrics from the font in the process of drawing each glyph into a bitmap context. These metrics result in more accurate kerning and better aligned baselines than the previous hard-coded values.
    
    Align iOS/macOS local glyph rasterization test fixture to Qt.
    1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    75bc946 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a52cc3e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d2f7c68 View commit details
    Browse the repository at this point in the history
  10. [ios, macos] Increased tolerance for local glyph rasterization test

    Co-authored-by: Alexander Shalamov <alexander.shalamov@mapbox.com>
    1ec5 and alexshalamov committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    afc8669 View commit details
    Browse the repository at this point in the history
  11. Add test for PingFang TC Semibold

    alexshalamov authored and 1ec5 committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    3d3b021 View commit details
    Browse the repository at this point in the history