Home
last modified time | relevance | path

Searched refs:measureText (Results 1 – 15 of 15) sorted by relevance

/cts/tests/tests/graphics/src/android/graphics/cts/
DTypefaceTest.java61 private static float measureText(String text, Typeface typeface) { in measureText() method in TypefaceTest
66 return paint.measureText(text); in measureText()
73 GLYPH_3EM_WIDTH = measureText("a", typeface);
74 GLYPH_1EM_WIDTH = measureText("b", typeface);
259 float widthDefaultTypeface = measureText(testString, Typeface.DEFAULT); in testInvalidCmapFont()
260 float widthCustomTypeface = measureText(testString, typeface); in testInvalidCmapFont()
270 float widthDefaultTypeface = measureText(testString, Typeface.DEFAULT); in testInvalidCmapFont2()
271 float widthCustomTypeface = measureText(testString, typeface); in testInvalidCmapFont2()
303 final float widthDefaultTypeface = measureText(testString, Typeface.DEFAULT); in testInvalidCmapFont_unsortedEntries()
304 final float widthCustomTypeface = measureText(testString, typeface); in testInvalidCmapFont_unsortedEntries()
[all …]
DTypefaceCustomFallbackBuilderTest.java195 assertEquals(10.0f, paint.measureText("a", 0, 1), 0.0f); in testUserFallback()
196 assertEquals(20.0f, paint.measureText("\u05D0", 0, 1), 0.0f); // Hebrew letter in testUserFallback()
253 assertEquals(10.0f, paint.measureText("a", 0, 1), 0.0f); in testUserFallbackOverLocaleFallback()
254 assertEquals(20.0f, paint.measureText("\u4E0D", 0, 1), 0.0f); // Hebrew letter in testUserFallbackOverLocaleFallback()
DPaintTest.java1226 widths[i] = p.measureText(text, i, i + 1); in testMeasureText()
1256 float width = p.measureText(shortString); in testMeasureTextContext()
1272 float width = p.measureText(longText, 0, 1); in testMeasureTextWithLongText()
1288 widths[0] = p.measureText(textSlice); in verifyMeasureText()
1289 widths[1] = p.measureText(textChars, start, count); in verifyMeasureText()
1290 widths[2] = p.measureText(textSpan, start, end); in verifyMeasureText()
1291 widths[3] = p.measureText(text, start, end); in verifyMeasureText()
1931 assertEquals(30.0f, paint.measureText("abc", 0, 3), 0.0f);
1935 assertEquals(50.0f, paint.measureText("abc", 0, 3), 0.0f); // "abc-" in visual.
1941 assertEquals(70.0f, paint.measureText("abc", 0, 3), 0.0f); // "-abc-" in visual.
[all …]
DPaintFlagsDrawFilterTest.java65 mTextWidth = p.measureText(TEXT); in drawText()
/cts/tests/tests/text/src/android/text/cts/
DStaticLayoutGetLineLeftRightTest.java113 mWidth = mLeadingMargin + (int) mPaint.measureText(mText, 0, mText.length()) / 10; in StaticLayoutGetLineLeftRightTest()
149 final float textWidth = mPaint.measureText(mText, start, end); in testGetLineLeft()
173 final float textWidth = mPaint.measureText(mText, start, end); in testGetLineRight()
DTextUtilsTest.java100 float width = p.measureText(text.substring(1)); in getEllipsis()
126 final float fullWidth = paint.measureText(fullString); in testListEllipsize()
196 final float enoughWidth = paint.measureText(expectedString); in testListEllipsize_rtl()
213 float textWidth = p.measureText("long, 3 plus"); in testCommaEllipsize()
224 textWidth = p.measureText("long, string, 2 more"); in testCommaEllipsize()
229 textWidth = p.measureText("long, string, to, truncate"); in testCommaEllipsize()
515 float textWidth = p.measureText(mEllipsis) + p.measureText("uncate"); in testEllipsize()
519 textWidth = p.measureText("long str") + p.measureText(mEllipsis); in testEllipsize()
523 textWidth = p.measureText("long") + p.measureText(mEllipsis) + p.measureText("ate"); in testEllipsize()
533 textWidth = p.measureText(mEllipsis); in testEllipsize()
[all …]
DStaticLayoutTest.java1116 final float width = mDefaultPaint.measureText(testString, 0, 6); in testGetOffsetForHorizontal_Multilines()
1221 int textWidth = (int) (mDefaultPaint.measureText(text) + 1);
1269 final float wholeWidth = mDefaultPaint.measureText(LOREM_IPSUM);
1283 final float wholeWidth = mDefaultPaint.measureText(LOREM_IPSUM);
1382 final float wholeWidth = mDefaultPaint.measureText(text.toString());
1544 final int width = (int) paint.measureText(spanStr0.toString()) / 5;
1577 final int width = (int) paint.measureText(spanStr.toString()) / 5;
1625 final int width = (int) paint.measureText(spanStr.toString()) / 5;
/cts/tests/tests/text/src/android/text/style/cts/
DTextAppearanceSpanTest.java317 final float originalTextWidth = tp.measureText("a"); in testCreateFromStyle_FontResource()
319 assertNotEquals(originalTextWidth, tp.measureText("a"), 0.0f); in testCreateFromStyle_FontResource()
370 final float originalSpanTextWidth = tp.measureText("a"); in testWriteReadParcel_FontResource()
372 assertEquals(originalSpanTextWidth, tp.measureText("a"), 0.0f); in testWriteReadParcel_FontResource()
387 final float originalSpanTextWidth = tp.measureText("a"); in testWriteReadParcel_FontResource_WithStyle()
389 assertEquals(originalSpanTextWidth, tp.measureText("a"), 0.0f); in testWriteReadParcel_FontResource_WithStyle()
439 final float originalTextWidth = tp.measureText("a"); in testRestrictContext()
442 assertEquals(originalTextWidth, tp.measureText("a"), 0.0f); in testRestrictContext()
/cts/tests/tests/text/src/android/text/method/cts/
DTouchTest.java121 int textWidth = Math.round(paint.measureText(text)); in testOnTouchEvent()
124 textWidth = Math.round(paint.measureText(text)); in testOnTouchEvent()
DBaseMovementMethodTest.java85 setContentView(mTextView, (int) mTextView.getPaint().measureText(testLine) / 3); in testOnGenericMotionEvent_horizontalScroll()
/cts/tests/tests/graphics/src/android/graphics/fonts/
DFontTestUtil.java228 return tp.measureText(new char[] { c }, 0, 1); in measureChar()
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewFontWeightTest.java115 final float width = paint.measureText(new char[] { c }, 0 /* index */, 1 /* count */); in assertFontSelected()
DTextViewTest.java3697 mTextView.getPaint().measureText("a") * 2f / 3f); in testGetOffsetForPositionSingleLineLtr()
3758 mTextView.getPaint().measureText("a") * 2f / 3f); in testGetOffsetForPositionMultiLineLtr()
3824 mTextView.getPaint().measureText("\u0635") * 2f / 3f); in testGetOffsetForPositionMultiLineRtl()
4395 mTextView.setWidth((int) (mTextView.getPaint().measureText(LONG_TEXT) / 4));
4422 mTextView.setWidth((int) Math.ceil(mTextView.getPaint().measureText(substring))); in testHyphenationNotHappen_frequencyNone()
4458 mTextView.setWidth((int) Math.ceil(mTextView.getPaint().measureText(substring))); in testHyphenationNotHappen_breakStrategySimple()
/cts/tests/autofillservice/src/android/autofillservice/cts/
DVirtualContainerView.java166 final float deltaX = mTextPaint.measureText(readOnlyText); in onDraw()
169 (int) (x + mTextPaint.measureText(writeText)), (int) y); in onDraw()
/cts/tests/tests/content/src/android/content/res/cts/
DResourcesTest.java826 float width1 = p1.measureText(text); in getLargerTypeface()
829 float width2 = p2.measureText(text); in getLargerTypeface()