예제 #1
0
HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
    : Shaper(font, run), m_normalizedBufferLength(0) {
  m_normalizedBuffer = wrapArrayUnique(new UChar[m_textRun.length() + 1]);
  normalizeCharacters(m_textRun, m_textRun.length(), m_normalizedBuffer.get(),
                      &m_normalizedBufferLength);
  setFontFeatures();
}
예제 #2
0
HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
    : HarfBuzzShaperBase(font, run)
    , m_fromIndex(0)
    , m_toIndex(m_run.length())
{
    m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
    m_normalizedBufferLength = m_run.length();
    normalizeCharacters(m_run.characters16(), m_normalizedBuffer.get(), m_normalizedBufferLength);
    setPadding(m_run.expansion());
    setFontFeatures();
}
예제 #3
0
HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
    : m_font(font)
    , m_normalizedBufferLength(0)
    , m_run(run)
    , m_wordSpacingAdjustment(font->wordSpacing())
    , m_padding(0)
    , m_padPerWordBreak(0)
    , m_padError(0)
    , m_letterSpacing(font->letterSpacing())
{
    m_normalizedBuffer = std::make_unique<UChar[]>(m_run.length() + 1);
    m_normalizedBufferLength = m_run.length();
    normalizeCharacters(m_run, m_normalizedBuffer.get(), m_normalizedBufferLength);
    setPadding(m_run.expansion());
    setFontFeatures();
}