use of com.mta.tehreer.internal.text.TopSpanIterator in project Tehreer-Android by mta452.
the class Typesetter method resolveFonts.
private void resolveFonts(int charStart, int charEnd, byte bidiLevel, ShapingEngine shapingEngine, Typeface typeface) {
Spanned spanned = mSpanned;
TopSpanIterator<TypeSizeSpan> iterator = new TopSpanIterator<>(spanned, charStart, charEnd, TypeSizeSpan.class);
while (iterator.hasNext()) {
TypeSizeSpan spanObject = iterator.next();
int spanStart = iterator.getSpanStart();
int spanEnd = iterator.getSpanEnd();
float typeSize;
if (spanObject == null) {
typeSize = DEFAULT_FONT_SIZE;
} else {
typeSize = spanObject.getSize();
if (typeSize < 0.0f) {
typeSize = 0.0f;
}
}
IntrinsicRun intrinsicRun = resolveGlyphs(spanStart, spanEnd, bidiLevel, shapingEngine, typeface, typeSize);
mIntrinsicRuns.add(intrinsicRun);
}
}
use of com.mta.tehreer.internal.text.TopSpanIterator in project Tehreer-Android by mta452.
the class Typesetter method resolveTypefaces.
private void resolveTypefaces(int charStart, int charEnd, byte bidiLevel, ShapingEngine shapingEngine) {
Spanned spanned = mSpanned;
TopSpanIterator<TypefaceSpan> iterator = new TopSpanIterator<>(spanned, charStart, charEnd, TypefaceSpan.class);
while (iterator.hasNext()) {
TypefaceSpan spanObject = iterator.next();
int spanStart = iterator.getSpanStart();
int spanEnd = iterator.getSpanEnd();
if (spanObject == null || spanObject.getTypeface() == null) {
throw new IllegalArgumentException("No typeface is specified for range [" + spanStart + ".." + spanEnd + ")");
}
resolveFonts(spanStart, spanEnd, bidiLevel, shapingEngine, spanObject.getTypeface());
}
}
Aggregations