static inline bool stringMatchesUnicodeRange(const String& unicodeString, const UnicodeRanges& ranges) { if (unicodeString.isEmpty()) return false; if (!ranges.isEmpty()) { UChar firstChar = unicodeString[0]; const UnicodeRanges::const_iterator end = ranges.end(); for (UnicodeRanges::const_iterator it = ranges.begin(); it != end; ++it) { if (firstChar >= it->first && firstChar <= it->second) return true; } } return false; }
static bool stringMatchesUnicodeRange(const String& unicodeString, const UnicodeRanges& ranges, const HashSet<String>& unicodeValues) { if (unicodeString.isEmpty()) return false; if (!ranges.isEmpty()) { UChar firstChar = unicodeString[0]; const UnicodeRanges::const_iterator end = ranges.end(); for (UnicodeRanges::const_iterator it = ranges.begin(); it != end; ++it) { if (firstChar >= it->first && firstChar <= it->second) return true; } } if (!unicodeValues.isEmpty()) return unicodeValues.contains(unicodeString); return false; }
Vector<SVGGlyph> SVGFontElement::buildGlyphList(const UnicodeRanges& unicodeRanges, const HashSet<String>& unicodeNames, const HashSet<String>& glyphNames) const { Vector<SVGGlyph> glyphs; if (!unicodeRanges.isEmpty()) { const UnicodeRanges::const_iterator end = unicodeRanges.end(); for (UnicodeRanges::const_iterator it = unicodeRanges.begin(); it != end; ++it) m_glyphMap.collectGlyphsForUnicodeRange(*it, glyphs); } if (!unicodeNames.isEmpty()) { const HashSet<String>::const_iterator end = unicodeNames.end(); for (HashSet<String>::const_iterator it = unicodeNames.begin(); it != end; ++it) m_glyphMap.collectGlyphsForStringExact(*it, glyphs); } if (!glyphNames.isEmpty()) { const HashSet<String>::const_iterator end = glyphNames.end(); for (HashSet<String>::const_iterator it = glyphNames.begin(); it != end; ++it) { const SVGGlyph& glyph = m_glyphMap.glyphIdentifierForGlyphName(*it); if (glyph.tableEntry) glyphs.append(glyph); } } return glyphs; }