android - Canvas.drawTextOnPath(...) not working on Lollipop -


canvas.DrawTextOnPath does not seem to work on a lollipop device. See the difference here (Nexus 10 image is correct but Lollipop does not display correctly)

 Image

The code is a simple path draw.

Path path = path to new path (); UnitPath.addArc (Unicent, 180.0F, 180.0F); // Insert canvas text and pathtextonepath ("inner circle", unit path, 0.0f, 0.0f, unitpent); Canvas.drawPath (unitPath, unitPaint);

The Android Studio Test Project, which reflects this issue, can be seen here for any person to see it.

Is there something "different" on this device?

OK, it seems that DrawTextOnPath is a bit broken, now 1.0f

< P> Below is the font size, the solution is to measure everything, drag back the text, then delete it below.

The method in the DrawTitle demo project will change with:

  Private zero-less title (canvas canvas) {Canvas Left Text Onpath (upper title, uppertitle path, 0.0F, 0.02 F, UnitPaint); Canvas.drawTextOnPath (loweratellite, lowertext path, 0.0f, 0.0f, unitpint); Canvas.drawTextOnPath (Unititle, Unit Path, 0.0F, 0.0F, UnitPaint); Canvas.drawPath (unitPath, unitPaint); }  

To do this:

  Private zero date (Canvas canvas) {// Save original font size Original original text size = UnitPaint.Get TextScase (); // A magnification factor last float magnifier = 100f set; // canvas canvas.Scene Scale; Canvas scale (1f / werner, 1f / werner); // Create new rules and paths on the basis of the new scale unit; = New Rhetfight (); UnitRect.set ((faceRect.left + unitPosition) * magnifier, (faceRect.top + unitPosition) * magnifier, (faceRect.right - unitPosition) * magnifier, (faceRect.bottom - unitPosition) * magnifier); Unit path = new path (); UnitPath.addArc (Unicent, 180.0F, 180.0F); TopCareck = new Rectif (); TitleRect.set ((faceRect.left + titlePosition) * magnifier, (faceRect.top + titlePosition) * magnifier, (faceRect.right - titlePosition) * magnifier, (faceRect.bottom - titlePosition) * magnificence); UpperTitpath = new path (); UpperTitpath.ADARC (Headquarters, 180.0F, 180.0F); TopCareck = new Rectif (); TitleRect.set ((faceRect.left + titlePosition) * magnifier, (faceRect.top + titlePosition) * magnifier, (faceRect.right - titlePosition) * magnifier, (faceRect.bottom - titlePosition) * magnificence); LowerTitlePath = new path (); LowerTitlePath.addArc (Headworks, -180.0F, -180.0F); // Increase the font size unit. Sitestext (Original Textstrost * Magnifier); // Illustrate the text canvas. Drawexonepath (unititle, unit path, 0.0f, 0.0f, unitpint); Canvas.drawTextOnPath (upperatimal, uppertitle path, 0.0f, 0.02f, unitpunt); Canvas.drawTextOnPath (loweratellite, lowertext path, 0.0f, 0.0f, unitpint); // Revert everything back to the normal canvas. Thor (); UnitPaint.setTextSize (originalTextSize); Canvas davapath (unit path, unitant); }  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -