Standalone text engine for Android aimed to be free from platform limitations
FrameResolver
:
setJustificationEnabled(boolean justificationEnabled)
, boolean isJustificationEnabled()
setJustificationLevel(float justificationLevel)
, float getJustificationLevel()
Typesetter
:
ComposedLine createJustifiedLine(int charStart, int charEnd, float justificationFactor, float justificationWidth)
TTextView
:
justificationEnabled
, justificationLevel
CaretEdgesBuilder
class for generating caret edges from a set of input parametersgetCaretEdges()
method in ShapingResult
to base on CaretEdgesBuilder
TextRun
from abstract class to an interfaceAbstractTextRun
class for providing helper implementation of some methodsTextRunDrawing
interface for separating drawing logic from a TextRun
implementationDefaultTextRunDrawing
class for reusing drawing logic in a TextRun
implementationIntrinsicRun
class to base on AbstractTextRun
IntrinsicRun
ReplacementRun
related implementation in its own classCaretEdges
class in IntrinsicRunSlice
to transform the edges of parent rundraw()
method in IntrinsicRunSlice
to base on DefaultTextRunDrawing
JustifiedRun
class to transform an existing text run into a justified oneLineResolver
and TextContainer
FrameResolver
Typeface
Typeface
into multiple classes on JNI sideRenderableFace
class for holding FT_Face in JNI
ShapableFace
class for holding custom implementation of hb_font in JNI
Java
sideNameTable
in Typeface
classLruCache
COLR
/ CPAL
tablesTypeface
:
List<String> getPaletteEntryNames()
List<ColorPalette> getPredefinedPalettes()
int[] getAssociatedColors()
Typeface getColorInstance(int[] colors)
TLabel
:
fill
, fill_stroke
, stroke
color
, width
, cap
, join
, miter
FontFile
:
List<Typeface> getTypefaces()
Typeface
:
List<VariationAxis> getVariationAxes()
float[] getVariationCoordinates()
Typeface getVariationInstance(float[] coordinates)
ShapingResult
:
FloatList getCaretEdges(boolean[] caretStops)
Added @Nullable
, @NonNull
, @Size
and @ColorInt
annotations throughout the project
ShapingEngine
:
setOpenTypeFeatures(Set<OpenTypeFeature> features)
, Set<OpenTypeFeature> getOpenTypeFeatures()
Typeface
:
int getStrikeoutPosition()
, int getStrikeoutThickness()
@IntDef
Annotations:
BidiClass
: @Value
GeneralCategory
: @Value
Script
: @Value
Precondition
class and used it for checking parameter expectations@Sustain
annotation in favour of androidx @Keep
annotationTLabel
widgeequals(Object)
implementation of NameTable.Record
BidiClass
:
GeneralCategory
:
Script
:
static int getOpenTypeTag(int script)
CodePoint
:
static int getBidiClass(int codePoint)
static int getGeneralCategory(int codePoint)
static int getScript(int codePoint)
static int getMirror(int codePoint)
BidiAlgorithm
:
IntList getCharBidiClasses()
ScriptClassifier
:
IntList getCharScripts()
Iterable<ScriptRun> getScriptRuns(int charStart, int charEnd)
GlyphRun
:
int getStartExtraLength()
, int getEndExtraLength()
Added support for cluster splitting in multiple spans
Wrote an abstract class for testing IntList
implementations
Used a dedicated Android.mk
file for instrumentation tests
Renderer
Renderer
GlyphRun
n
prefixGlyphRun
GlyphRun
TypeFamily
:
getTypefaceByStyle(TypeWidth, TypeWeight, TypeSlope)
TypefaceManager
:
getTypeFamily(String familyName)
TextAlignment
:
INTRINSIC
, EXTRINSIC
GlyphRun
:
int getActualClusterStart(int charIndex)
, int getActualClusterEnd(int charIndex)
int getLeadingGlyphIndex(int charIndex)
, int getTrailingGlyphIndex(int charIndex)
float computeCharDistance(int charIndex)
, int computeNearestCharIndex(float distance)
ComposedLine
:
float computeCharDistance(int charIndex)
, int computeNearestCharIndex(float distance)
float[] computeVisualEdges(int charStart, int charEnd)
CompsedFrame
:
originX
, originY
, width
, height
int getLineIndexForChar(int charIndex)
, int getLineIndexForPosition(float x, float y)
Path generateSelectionPath(int charStart, int charEnd)
TLabel
:
extraLineSpacing
, lineHeightMultiplier
composedFrame
, spanned
, typesetter
int hitTestPosition(float x, float y)
Added FrameResolver
class for easier text layout and measurement.
Added support for following CharacterStyle
spans without invoking updateDrawState(TextPaint)
or updateMeasureState(TextPaint)
:
Added support for following ParagraphStyle
spans:
Typesetter
into various logical classesTypefaceSpan
and TypeSizeSpan
conform to MetricAffectingSpan
for easier span handlingNullPointerException
caused by NameTable
on older android versionsgravity
attribute of TLabel
with flag formatRenderer
createCompactLine
private in Typesetter