TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion)
{
    ASSERT(offset + length <= text->textLength());
    if (text->is8Bit())
        return constructTextRunInternal(context, font, text->characters8() + offset, length, style, direction, expansion);
    return constructTextRunInternal(context, font, text->characters16() + offset, length, style, direction, expansion);
}
TextRun constructTextRun(RenderObject* context, const Font& font, const String& string, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
{
    unsigned length = string.length();
    if (!length)
        return constructTextRunInternal(context, font, static_cast<const LChar*>(0), length, style, direction, expansion, flags);
    if (string.is8Bit())
        return constructTextRunInternal(context, font, string.characters8(), length, style, direction, expansion, flags);
    return constructTextRunInternal(context, font, string.characters16(), length, style, direction, expansion, flags);
}
TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, RenderStyle* style, TextRun::ExpansionBehavior expansion)
{
    ASSERT(offset + length <= text->textLength());
    TextRun run = text->is8Bit()
                  ? constructTextRunInternal(context, font, text->characters8() + offset, length, style, LTR, expansion)
                  : constructTextRunInternal(context, font, text->characters16() + offset, length, style, LTR, expansion);
    bool hasStrongDirectionality;
    run.setDirection(directionForRun(run, hasStrongDirectionality));
    return run;
}
Esempio n. 4
0
TextRun constructTextRun(const Font& font,
                         const String& string,
                         const ComputedStyle& style,
                         TextDirection direction,
                         TextRunFlags flags) {
  unsigned length = string.length();
  if (!length)
    return constructTextRunInternal(font, static_cast<const LChar*>(nullptr),
                                    length, style, direction, flags);
  if (string.is8Bit())
    return constructTextRunInternal(font, string.characters8(), length, style,
                                    direction, flags);
  return constructTextRunInternal(font, string.characters16(), length, style,
                                  direction, flags);
}
Esempio n. 5
0
TextRun constructTextRun(const Font& font,
                         const LayoutText* text,
                         unsigned offset,
                         unsigned length,
                         const ComputedStyle& style,
                         TextDirection direction) {
  ASSERT(offset + length <= text->textLength());
  if (text->hasEmptyText())
    return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0,
                                    style, direction);
  if (text->is8Bit())
    return constructTextRunInternal(font, text->characters8() + offset, length,
                                    style, direction);
  return constructTextRunInternal(font, text->characters16() + offset, length,
                                  style, direction);
}
Esempio n. 6
0
TextRun constructTextRun(const Font& font,
                         const UChar* characters,
                         int length,
                         const ComputedStyle& style,
                         TextDirection direction) {
  return constructTextRunInternal(font, characters, length, style, direction);
}
Esempio n. 7
0
TextRun constructTextRun(const Font& font,
                         const LineLayoutText text,
                         unsigned offset,
                         unsigned length,
                         const ComputedStyle& style) {
  ASSERT(offset + length <= text.textLength());
  if (text.hasEmptyText())
    return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0,
                                    style, LTR);
  if (text.is8Bit())
    return constructTextRunInternal(font, text.characters8() + offset, length,
                                    style, LTR);

  TextRun run = constructTextRunInternal(font, text.characters16() + offset,
                                         length, style, LTR);
  run.setDirection(directionForRun(run));
  return run;
}
TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion)
{
    if (text->is8Bit())
        return constructTextRunInternal(context, font, text->characters8(), text->textLength(), style, direction, expansion);
    return constructTextRunInternal(context, font, text->characters16(), text->textLength(), style, direction, expansion);
}
TextRun constructTextRun(RenderObject* context, const Font& font, const UChar* characters, int length, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion)
{
    return constructTextRunInternal(context, font, characters, length, style, direction, expansion);
}