MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getCharacters

Method getCharacters

snap_drawing/src/snap_drawing/cpp/Text/Harfbuzz.cpp:76–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76Ref<Valdi::CharacterSet> HBFace::getCharacters() {
77 auto* set = hb_set_create();
78 hb_face_collect_unicodes(_ptr, set);
79
80 std::vector<Valdi::CharacterRange> ranges;
81 ranges.reserve(countRanges(set));
82
83 hb_codepoint_t first = 0;
84 hb_codepoint_t last = HB_SET_VALUE_INVALID;
85
86 while (hb_set_next_range(set, &first, &last) != 0) {
87 ranges.emplace_back(static_cast<uint32_t>(first), static_cast<uint32_t>(last));
88 }
89
90 hb_set_destroy(set);
91
92 return Valdi::CharacterSet::make(ranges.data(), ranges.size());
93}
94
95HBFont::HBFont(HBFont&& other) noexcept : HBResource<hb_font_t>(other._ptr) {
96 other._ptr = nullptr;

Callers 1

TypefaceMethod · 0.80

Calls 4

countRangesFunction · 0.85
reserveMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected