bool SVGFontData::fillSVGGlyphPage(GlyphPage* pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) const { ASSERT(fontData->isCustomFont()); ASSERT(fontData->isSVGFont()); SVGFontFaceElement* fontFaceElement = this->svgFontFaceElement(); ASSERT(fontFaceElement); SVGFontElement* fontElement = fontFaceElement->associatedFontElement(); ASSERT(fontElement); if (bufferLength == length) return fillBMPGlyphs(fontElement, pageToFill, offset, length, buffer, fontData); ASSERT(bufferLength == 2 * length); return fillNonBMPGlyphs(fontElement, pageToFill, offset, length, buffer, fontData); }
// We're supposed to return true if there are any glyphs in the range // specified by |offset| and |length| in our font, // false if there are none. bool GlyphPage::fill(unsigned offset, unsigned length, UChar* characterBuffer, unsigned bufferLength, const SimpleFontData* fontData) { // We have to handle BMP and non-BMP characters differently. // FIXME: Add assertions to make sure that buffer is entirely in BMP // or entirely in non-BMP. if (bufferLength == length) return fillBMPGlyphs(offset, length, characterBuffer, this, fontData, true); if (bufferLength == 2 * length) { // A non-BMP input buffer will be twice as long as output glyph buffer // because each character in the non-BMP input buffer will be // represented by a surrogate pair (two UChar's). return fillNonBMPGlyphs(offset, length, characterBuffer, this, fontData); } ASSERT_NOT_REACHED(); return false; }