mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Dummy glyphs in font atlas #1703
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#1703
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello omar,
I've found about a few thousand dummy glyphs in my font atlas when loading a CJK font.
See attached pic.
Is there a quick way to detect them and prevent them included in the final font atlas?
I would rather like a '?'/unused glyph in those dummy boxes instead :)
Ty!
PS: ImGui 1.60 beta
Hello,
Yes this indeed an issue with the current code. Will tackle it shortly. This is essentially waiting for the same solution as #1671.
The
stbtt_PackFontRangesGatherRects()call in stb_truetype don't check for missing glyph which ends up rendering the first glyph of the font, we need to refactor a bit of the font building function.Aha great! Ty for pointing that out.
I'll leave the issue open for you as a reminder.
For now, and as a workaround, I've just discarded glyph as well, only if both dummy_x and dummy_y are 0.
2nd try: I've just tweaked stb_truetype to forbid baking of missing glyphs. Feels hacky but texture atlas fits nicely!
@r-lyeh This should be fixed in master now, could you confirm it does what you want with your font?
(Note that it was a minor bug that the Demo displayed ? at all here, the greyed out rectangles were meant to be left empty)
I submitted my modification to nothings/stb, I'm not sure it'll be merged as is (perhaps as an option to the packer) but either way I'll follow on that and hopefully the next version of stb_truetype will match our mod.
Cool. I'll let you know!
No problems found :)