Comments (16)
So, judging from the r
character, the non-ImGUI window is using Terminus, whereas the ImGUI window is using unifont, so this is indeed related to #73061. The blurry characters is actually a separate issue related to unifont. The unifont we're using is a vector font without embedded bitmap font for specific font sizes, so it renders across pixel boundaries resulting in gray pixels.
I made a modified unifont file with embedded bitmap font for font size 16 in #66749 which can probably work around this problem. That PR has stalled, but you can try replacing data/font/unifont.ttf
with the version in that PR and see if it fixes the blurry characters.
I'm not sure if we can fix it for all font sizes though. Previous I tried to shift the glyphs horizontally by a fraction of a pixel but that still resulted in blurry characters. Subpixel rendering might fix it but it was more complicated than I expected. Maybe we can let the user turn antialiasing on or off for individual fonts, which might fix it.
from cataclysm-dda.
Fooled around in the options a bit. This appears to be an issue related to having the Renderer option set to "software". On opengl setting the problem is gone, the window looks exactly like it does on Windows.
from cataclysm-dda.
Looks like the ImGUI window is using a different font. For example the r
looks different from the non-ImGUI window. Also, if you look closely you can see that the ImGUI font has gray pixels which suggests that it fails to use the bitmap version of the vector font. Could you post your config/fonts.json
?
from cataclysm-dda.
I do not remember changing anything of this, so it is probably the default.
{
"typeface": [ "Terminus", "unifont" ],
"map_typeface": [ "Terminus", "unifont" ],
"overmap_typeface": [ "Terminus", "unifont" ]
}
Additionally, have all the font-specific options in options.json
I grepped::
{ "info": "Highlight selected item's contents and parent container in inventory screen. \"Symbol\" shows a highlighted caret and \"Highlight\" uses font highlighting.", "default": "Default: symbol - Values: symbol, highlight, disable", "name": "INVENTORY_HIGHLIGHT", "value": "symbol" },
{ "info": "If true, will display scrolling combat text with Unicode font.", "default": "Default: True", "name": "ANIMATION_SCT_USE_FONT", "value": "true" },
{ "info": "If true, vector fonts may look better.", "default": "Default: False", "name": "FONT_BLENDING", "value": "true" },
{ "info": "Set the font width. Requires restart.", "default": "Default: 8 - Min: 6, Max: 100", "name": "FONT_WIDTH", "value": "8" },
{ "info": "Set the font height. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "FONT_HEIGHT", "value": "16" },
{ "info": "Set the font size. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "FONT_SIZE", "value": "16" },
{ "info": "Set the map font width. Requires restart.", "default": "Default: 16 - Min: 6, Max: 100", "name": "MAP_FONT_WIDTH", "value": "16" },
{ "info": "Set the map font height. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "MAP_FONT_HEIGHT", "value": "16" },
{ "info": "Set the map font size. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "MAP_FONT_SIZE", "value": "16" },
{ "info": "Set the overmap font width. Requires restart.", "default": "Default: 16 - Min: 6, Max: 100", "name": "OVERMAP_FONT_WIDTH", "value": "16" },
{ "info": "Set the overmap font height. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "OVERMAP_FONT_HEIGHT", "value": "16" },
{ "info": "Set the overmap font size. Requires restart.", "default": "Default: 16 - Min: 8, Max: 100", "name": "OVERMAP_FONT_SIZE", "value": "16" },
{ "info": "If true, use SDL ASCII line drawing routine instead of Unicode Line Drawing characters. Use this option when your selected font doesn't contain necessary glyphs.", "default": "Default: True", "name": "USE_DRAW_ASCII_LINES_ROUTINE", "value": "true" },
from cataclysm-dda.
That PR has stalled, but you can try replacing data/font/unifont.ttf with the version in that PR and see if it fixes the blurry characters.
I did but it does look even worse in this case than without the modified font. Worth a try though.
from cataclysm-dda.
I did but it does look even worse in this case than without the modified font.
Could you post a screenshot?
from cataclysm-dda.
Sure, with your custom font:
Without:
from cataclysm-dda.
Looks like it's still using the vector version of the font. Not sure if there's something wrong with the font or how ImGUI handles embedded bitmap font.
from cataclysm-dda.
Looks like it uses the bitmap glyphs for Chinese characters but uses the vector glyphs for English characters, and the color is also different. Intriguing. @katemonster33 Do you have any idea why this happens?
from cataclysm-dda.
Looks like it uses the bitmap glyphs for Chinese characters but uses the vector glyphs for English characters, and the color is also different. Intriguing. @katemonster33 Do you have any idea why this happens?
This happens because of #72579 , to get around ImGui's font rendering so that we can draw CJK characters without needing to cache all of them, I made ImGui call into CDDA's font rendering code to draw any character which doesn't exist in its cache.
We could have the same logic apply to all font drawing in ImGui, just have every character drawn by CDDA's code. This would have the added benefit of fixing the issue where ImGui does not respect the user's font choice. The only issue I could see would be the extra CPU usage, because ImGui screens tend to draw more frequently than the old screens. ImGui has this nice logic where it renders text in huge batches using SDL_RenderGeometry which makes it very efficient. But maybe the CPU hit won't be too bad.
from cataclysm-dda.
very weird. in windows the imgui UIs look fine.
from cataclysm-dda.
I zoomed in on the 'X' button on the window. Linux on top, Windows on bottom.
seems like transparency is off in linux? but why? so strange
from cataclysm-dda.
Is ImGUI using SDL for font rendering? If so you might want to check what blending mode and font hinting is used in Linux and Windows.
from cataclysm-dda.
My settings, for reference. I am also using the software renderer since ages.
from cataclysm-dda.
I can confirm that the fonts look so much more crisp on opengl
from cataclysm-dda.
I am using direct3d11 and the font also looks blurry. Changing to opengl does not fix it either. My game is compiled with MinGW-w64, if that matters.
from cataclysm-dda.
Related Issues (20)
- ImGui: QueryYN doesn't highlight selected option HOT 7
- Filter quality by level
- Filter in crafting menu: NOT from components HOT 2
- Monster special attack cooldowns should be allowed to use math HOT 1
- Add recipes for food handling level 7 and above HOT 5
- Magiclysm: Cat's Grace should list Ogre's Strength in it's remove_effects code [low priority] HOT 6
- Road maps should be good reading material
- Give Forge of Wonder a Translocator Gate HOT 4
- No such parameter "variant_palette" HOT 2
- Backing out of a craft which requires moving a liquid beforehand doesn't cancel the craft and causes your liquid to be lost. HOT 2
- [Android] Mission menu scrolling bug HOT 5
- misc repair kit requires bow saw or wood saw, but bow saw is bigger than the kit, has higher tree cut quality and isn't returned on dissasembly. HOT 3
- Changing autolearn into "figuring it out" HOT 22
- Six-pack ring holders for beer cans HOT 1
- Make Fleet-Footed no longer a possible starting trait, introduce 2 new traits for increased walking and running speed. HOT 5
- Rare specials accidentally became too frequent HOT 5
- No low stamina sfx! HOT 2
- Mound of Upturned Dirt Inconsistency
- Dead End Sewer HOT 1
- Electric blankets have "When full" encumbrance of 800035 HOT 1
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 cataclysm-dda.