| Flutter Impeller |

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< Rect > | FindGlyphBounds (const Glyph &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 185 of file glyph_atlas.h.

## Constructor & Destructor Documentation

## ◆ FontGlyphAtlas()

impeller::FontGlyphAtlas::FontGlyphAtlas | ( |  | ) |
| default

## Member Function Documentation

## ◆ FindGlyphBounds()

std::optional< Rect > impeller::FontGlyphAtlas::FindGlyphBounds | ( | const Glyph & | glyph | ) | const

Find the location of a glyph in the atlas.

Parameters

  [in] | glyph | The glyph

Returns
  The location of the glyph in the atlas. `std::nullopt` if the glyph is not in the atlas.

Definition at line 111 of file glyph_atlas.cc.

111 {
112 const auto& found = positions_.find(glyph);
113 if (found == positions_.end()) {
114 return std::nullopt;
115 }
116 return found->second;
117 }

Referenced by impeller::TypographerContextSkia::CreateGlyphAtlas(), impeller::TypographerContextSTB::CreateGlyphAtlas(), and impeller::TextContents::Render().

## Friends And Related Function Documentation

## ◆ GlyphAtlas

friend class GlyphAtlas
| friend

Definition at line 200 of file glyph_atlas.h.

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

- impeller/typographer/glyph_atlas.h
- impeller/typographer/glyph_atlas.cc