Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images in labels #8904

Merged
merged 1 commit into from
Nov 25, 2019
Merged

Images in labels #8904

merged 1 commit into from
Nov 25, 2019

Commits on Nov 25, 2019

  1. Implement 'images in labels' feature (#8904)

    * Set 'isSDF' flag per icon quad
    
    * Simplify formatted expression parsing
      Allow omission of empty section options objects. This enables
      following syntax ["format", "first section\n",
                                  "second section\n",
                                  ["image", "smiley"],
                                  "third section"]
    
    * Add Image to Format expression
      Image could be part of Format expression and evaluated ResolvedImage
      is a optional member of evaluated Formatted type.
    
    * Add formatted text's image section image to deps
    
    * Add images to TaggedString's section
    
    * Pass images to text shaping
    
    * Use {text|icon}-size vertex attribute field to encode 'isSDF' flag
      This change uses higher bit to indicate whether quad's vertices
      belong to a quad whose texture should be rasterized using SDF function.
      Size scaling factor is changed from 256 to 128, which reduces resolution
      a bit, however, as the scaling result is now being rounded, final result
      should be the same.
    
    * Shape images in labels
    
    * Draw color icons and sdf text with one program / draw call
    
    * Align images and scaled glyphs in vertical layout
    
    * Allow image breaking
    
    * Update render test expectations for tests using font-scale
      Fixes misaligned text boxes
    
    * Update format expression tests to account for image sections
    
    * Update quads unit test
    
    * Update shaping unit test
    
    * Update unit test for format expression API
    
    * Fix linter errors
    
    * Don't scale images in labels with text size
    
    * Basic render test
    
    * Multiline test
    
    * Vertical layout with images
    
    * Line placement test
    
    * Expression test for image section
    
    * Format expression unit and API test
    
    * Shaping unit test
    
    * Add benchmarks for symbol layer with icons
    
    * Use explicit 'symbol_text_and_icon' shader name instead of 'symbol'
      Add is_text back, in follow-up pr shader can be renamed to sdf and
      raster, and can be used to draw sdf and raster icons in one pass.
    
    * Don't use mod for unpacking flag
    
    * Use linear interpolation for images in label for zoom dependent text size
    
    * Add back glyphMap to shaping
      Glyph map is used as a fallback whenever glyph is missing in glyph
      positions, e.g., space character that may not be backed by a texture,
      yet, has a glyph metrics.
    
    * Render test for constant text-size
    
    * Render test for image justification
    
    * Take into account image padding and image pixel ratio
    
    * Add render test to verify that linear filtering is used
      Test that linear filtering is used for icons in text when
      text-size is zoom-dependent.
    
    * Fix size of images in text at integer zoom levels
    
    * Update shaping unit test and remove unused parameter from shapeLines
    alexshalamov committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    0f0cbba View commit details
    Browse the repository at this point in the history