GithubHelp home page GithubHelp logo

Comments (10)

Canardian avatar Canardian commented on May 2, 2024

Your screenshots are not public, so nobody can see them except you.

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

There is some logic in Font already to adjust the font Y-positioning, but it probably is not sufficient.

For manually adjusting the position of a text within a button I would just use the element's position, not a new value, as UI elements already are complex enough to edit.

from urho3d.

friesencr avatar friesencr commented on May 2, 2024

I am working on the editor and brining this back from the grave. Is there a way to theme in a global font offset?

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

If you want a truly global font offset, I believe that has to be added to the UI subsystem.

from urho3d.

friesencr avatar friesencr commented on May 2, 2024

Here are updated images of the problem.

urho3d_editor_-_untitled

It is like there is 1 pixel of space at the top. Our ui is so compact that 1 pixel is make or break.

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

If the font has been authored in such way that there's emptiness above in the glyphs, then yes, that will happen. Maybe the cleanest solution would be to add an accompanying optional xml for font resources, which allows to set an offset. In this case, a truly "global" setting (which I understand to mean "applied for all fonts") would not be useful.

Another way may be to detect emptiness in glyphs and adjust it away.

from urho3d.

weitjong avatar weitjong commented on May 2, 2024

IMHO, the issue is not the baseline positioning of font rendering in general. So I agree that having the global vertical offset does not help. Using the Editor's Hierarchy Window as an example, it will definitely break when one changes the font face/family or changes the font size arbitrary without also changes the corresponding EditorHierarchyWindow.xml file, which by the way is designed with 11pt Anonymous Pro font in mind. The "Expand" and "Collapse" buttons are even both designed with fixed height (17 pixels). Any other fonts that do not have the same metrics as the original designed font would surely break the visual.

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

Now you can write an XML config file next to a font to adjust glyph offset. For example to lift letters up by one tenth of point size you'd do:

<font>
    <scaledoffset y="-0.1" />
</font>

from urho3d.

friesencr avatar friesencr commented on May 2, 2024

Thanks Lasse. How would that work if the font had multiple sizes?

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

In the example above, the adjustment would be 1 pixel at point size 10, and 2 pixels at point size 20, with the idea that the different point sizes are just different renders of the same font design, so the adjustment should also be proportional.

from urho3d.

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.