Comments (10)
Your screenshots are not public, so nobody can see them except you.
from urho3d.
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.
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.
If you want a truly global font offset, I believe that has to be added to the UI subsystem.
from urho3d.
Here are updated images of the problem.
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.
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.
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.
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.
Thanks Lasse. How would that work if the font had multiple sizes?
from urho3d.
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)
- Lua Sample 12 coroutine usage HOT 1
- Crash in UI::Update() HOT 3
- ios crash HOT 1
- Dropping 32 bit support HOT 6
- Dropping DirectX 9 support
- Segfault on SetModel in headless mode HOT 4
- Dropping macOS support HOT 4
- DropDownList displayed element is not vertically centered HOT 1
- SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS always 0 when build 32-bit version of the engine on 64-bit Linux Mint HOT 5
- Non-Master AnimatedModel Removing Skeleton
- Dot at the end of a doxygen comment HOT 7
- Error building on Windows + MSYS + MinGW-W64 HOT 1
- Dockerize-web broken HOT 2
- Not building on arch Linux. HOT 3
- Toolset Visual Studio 2022 (v143) поломан HOT 12
- Не работает превью ресурсов в редакторе HOT 13
- Использовать нижний регистр для файлов HOT 2
- Build failes on (Void) Linux with make HOT 6
- -gl2 поломан
- Малая понятность CMake скриптов
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urho3d.