Skip to content
Permalink
Browse files

Curved path text rendering improvements #1112

  • Loading branch information...
devemux86 committed Mar 30, 2019
1 parent d5359eb commit 516dd6c83e7ec580c41418cc450fa926ffba65a0
@@ -196,6 +196,7 @@ public void drawPathText(String text, Path path, Paint paint) {
}

android.graphics.Paint androidPaint = AndroidGraphicFactory.getPaint(paint);
// Way text container was made larger by text height
this.canvas.drawTextOnPath(text, AndroidGraphicFactory.getPath(path), 0, androidPaint.getTextSize() / 4, androidPaint);
}

@@ -1,5 +1,6 @@
/*
* Copyright 2019 Adrian Batzill
* Copyright 2019 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -124,7 +125,8 @@ public Shape createStrokedShape(Shape shape) {
t.setToTranslation(x, y);
t.rotate(angle);
t.translate(-px - advance, -py);
t.translate(0, glyphVector.getVisualBounds().getHeight() / 2);
// Way text container was made larger by text height
t.translate(0, glyphVector.getVisualBounds().getHeight() / 4);
result.append(t.createTransformedShape(glyph), false);
next += (advance + nextAdvance) * factor;
currentChar++;

0 comments on commit 516dd6c

Please sign in to comment.
You can’t perform that action at this time.