|
@@ -218,10 +218,12 @@ public: |
|
|
void getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) override
|
|
|
void getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) override
|
|
|
{
|
|
|
{
|
|
|
JNIEnv* env = getEnv();
|
|
|
JNIEnv* env = getEnv();
|
|
|
const int numChars = text.length();
|
|
|
|
|
|
|
|
|
auto jtext = javaString (text);
|
|
|
|
|
|
|
|
|
|
|
|
const int numChars = env->GetStringLength (jtext.get());
|
|
|
jfloatArray widths = env->NewFloatArray (numChars);
|
|
|
jfloatArray widths = env->NewFloatArray (numChars);
|
|
|
|
|
|
|
|
|
const int numDone = paint.callIntMethod (AndroidPaint.getTextWidths, javaString (text).get(), widths);
|
|
|
|
|
|
|
|
|
const int numDone = paint.callIntMethod (AndroidPaint.getTextWidths, jtext.get(), widths);
|
|
|
|
|
|
|
|
|
HeapBlock<jfloat> localWidths (static_cast<size_t> (numDone));
|
|
|
HeapBlock<jfloat> localWidths (static_cast<size_t> (numDone));
|
|
|
env->GetFloatArrayRegion (widths, 0, numDone, localWidths);
|
|
|
env->GetFloatArrayRegion (widths, 0, numDone, localWidths);
|
|
|