Giter VIP home page Giter VIP logo

Comments (5)

PrimaryFeather avatar PrimaryFeather commented on June 16, 2024

Hey Anton!

Could you maybe add a small sample and screenshot so that it's easier for me to reproduce? Thanks!!

from starling-framework.

CrazyFlasher avatar CrazyFlasher commented on June 16, 2024

Hi. Prestory: I have some issues with all related Apple (iOS, MacOS) products in Chrome browser and given font and Thailand language :)
image
Some of the symbols are too tall and do now fit.
On is screen, I've set 50 to leading, but last line in this case (and the first line in other cases) are vertically cutted.
This is a phrase used on screen:

สัญลักษณ์อักขระ
หลักของคุณ
ระหว่างรอบโบนัส
การหมุนฟรี

By the way, on Windows or Android - everything is fine.

Is there a way to add some padding or offset in case, when real height of the character is more than font size?

UPD: If textfield contains only 1 line, adding leading helps in this case

from starling-framework.

JohnBlackburne avatar JohnBlackburne commented on June 16, 2024

Fonts are a known cause of incompatibilities between platforms for Flash/AIR apps. If you don’t embed fonts it uses system fonts which can lead to different output. This is especially an issue for languages like Chinese, where fonts might be too big to include. But it can happen in any language, including English – as a Mac user I have had many experiences of Flash games with broken text from developers who tested only on Windows.

I don’t know what the cause is but if you use an embedded font it should ensure similar output across platforms so might fix it, while giving your users a more consistent experience across platforms.

from starling-framework.

CrazyFlasher avatar CrazyFlasher commented on June 16, 2024

I cannot use embedded fonts.
So the only ugly workaround I found to add "\n" + text + "\n" to fix the issue visually

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on June 16, 2024

As John said, this is probably one of the known compatibility / rendering problem of fonts in Flash/AIR. The thing is: if it's not a bitmap font, Starling doesn't do the font rendering itself. It just draws a Flash TextField into a texture. So if Flash/AIR does it in the wrong way, Starling will — and it looks like this is happening here.

However, you say you cannot use embedded fonts – but don't rule it out altogether. If you know at compile time exactly which glyphs are needed, you can also selectively embed those fonts, which will greatly reduce the memory requirements. Here is a quick sample of how that works, but you'll probably find more information about it online. Perhaps that's an option?

from starling-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.