Example #1
0
 ~TextRunWalker()
 {
     fastFree(m_item.font);
     deleteGlyphArrays();
     delete[] m_item.log_clusters;
     if (m_item.face)
         HB_FreeFace(m_item.face);
 }
 ~TextRunWalker()
 {
     fastFree(m_item.font);
     deleteGlyphArrays();
     delete[] m_item.log_clusters;
     if (m_item.item.bidiLevel)
         delete[] m_item.string;
 }
    void shapeGlyphs()
    {
        for (;;) {
            if (HB_ShapeItem(&m_item))
                break;

            // We overflowed our arrays. Resize and retry.
            // HB_ShapeItem fills in m_item.num_glyphs with the needed size.
            deleteGlyphArrays();
            // The |+ 1| here is a workaround for a bug in Harfbuzz: the Khmer
            // shaper (at least) can fail because of insufficient glyph buffers
            // and request 0 additional glyphs: throwing us into an infinite
            // loop.
            createGlyphArrays(m_item.num_glyphs + 1);
        }
    }
void ComplexTextController::shapeGlyphs()
{
    // HB_ShapeItem() resets m_item.num_glyphs. If the previous call to
    // HB_ShapeItem() used less space than was available, the capacity of
    // the array may be larger than the current value of m_item.num_glyphs.
    // So, we need to reset the num_glyphs to the capacity of the array.
    m_item.num_glyphs = m_glyphsArrayCapacity;
    resetGlyphArrays();
    while (!HB_ShapeItem(&m_item)) {
        // We overflowed our arrays. Resize and retry.
        // HB_ShapeItem fills in m_item.num_glyphs with the needed size.
        deleteGlyphArrays();
        // The |+ 1| here is a workaround for a bug in Harfbuzz: the Khmer
        // shaper (at least) can fail because of insufficient glyph buffers
        // and request 0 additional glyphs: throwing us into an infinite
        // loop.
        createGlyphArrays(m_item.num_glyphs + 1);
    }
}
Example #5
0
 bool expandGlyphArrays()
 {
     deleteGlyphArrays();
     m_maxGlyphs <<= 1;
     return createGlyphArrays();
 }
Example #6
0
 ~TextRunWalker()
 {
     fastFree(m_item.font);
     deleteGlyphArrays();
     delete[] m_item.log_clusters;
 }