Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
impeller::FontGlyphAtlas Class Reference

An object that can look up glyph locations within the GlyphAtlas for a particular typeface. More...

#include <glyph_atlas.h>

Public Member Functions

 FontGlyphAtlas ()=default
 
std::optional< std::pair< Rect, Rect > > FindGlyphBounds (const SubpixelGlyph &glyph) const
 Find the location of a glyph in the atlas. More...
 

Friends

class GlyphAtlas
 

Detailed Description

An object that can look up glyph locations within the GlyphAtlas for a particular typeface.

Definition at line 200 of file glyph_atlas.h.

Constructor & Destructor Documentation

◆ FontGlyphAtlas()

impeller::FontGlyphAtlas::FontGlyphAtlas ( )
default

Member Function Documentation

◆ FindGlyphBounds()

std::optional< std::pair< Rect, Rect > > impeller::FontGlyphAtlas::FindGlyphBounds ( const SubpixelGlyph glyph) const

Find the location of a glyph in the atlas.

Parameters
[in]glyphThe glyph
Returns
The location of the glyph in the atlas. std::nullopt if the glyph is not in the atlas.

Definition at line 119 of file glyph_atlas.cc.

120 {
121 const auto& found = positions_.find(glyph);
122 if (found == positions_.end()) {
123 return std::nullopt;
124 }
125 return found->second;
126}

Friends And Related Function Documentation

◆ GlyphAtlas

friend class GlyphAtlas
friend

Definition at line 216 of file glyph_atlas.h.


The documentation for this class was generated from the following files: