Anonymous | Login | 2021-01-20 13:47 MSK | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0031678 | Open CASCADE | [OCCT] OCCT:Visualization | public | 2020-07-21 13:35 | 2020-09-21 17:42 | ||||||||
Reporter | nds | ||||||||||||
Assigned To | kgv | ||||||||||||
Priority | normal | Severity | feature | ||||||||||
Status | assigned | Resolution | open | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | |||||||||||||
Target Version | [OCCT] 7.6.0* | Fixed in Version | |||||||||||
Summary | 0031678: Visualization - add option enabling hinting for textured fonts | ||||||||||||
Description | Setting color for text aspect gives different result in the viewer. Calling the attached script on the current master and OCCT release 7.3.0 gives different result, shown on attached images. | ||||||||||||
Steps To Reproduce | pload ALL vinit vsetcolorbg 255 255 255 vlight -clear vlight -add ambient vtrihedron t1 -drawAxes XY -arrowColor 0 0 0 -color Whole 0 0 0 -textColor 0 0 0 vdrawtext text1 surprise -pos 100 100 0 -color 0 0 0 -height 20 vdrawtext text2 20.07.2020 -pos 100 -100 0 -color 0.1725 0.4745 0.70196 -height 20 vdrawtext text3 surprise -pos -200 100 0 -color 0 0 0 -height 20 -font "Segoe UI" vdrawtext text4 20.07.2020 -pos -200 -100 0 -color 0.1725 0.4745 0.70196 -height 20 -font "Segoe UI" vfit vtop vzoom 0.5 | ||||||||||||
Tags | No tags attached. | ||||||||||||
Test case number | |||||||||||||
Attached Files | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ||||||||||||
![]() |
|
(0093225) kgv (developer) 2020-07-21 14:14 edited on: 2020-07-21 14:15 |
This is not a bug, this is how graphics hardware performs color blending. After 0029528, some text/background combinations become a little bit more readable and some less - no strict evidence that it become only worse has been identified on testing. The workaround is adjusting colors / fonts / text styles for the cases, where readability looks unpleasant. Disabling GL_FRAMEBUFFER_SRGB specifically for text elements can be considered option, but for now it does not look reasonable, as it just will make text blending worse/better for different backgrounds combinations. Better alternatives for rendering text to be investigated (no ideas so far). |
(0093229) kgv (developer) 2020-07-21 15:08 edited on: 2020-07-21 15:09 |
Test case in bug description is incorrect - it uses different text colors for OCCT 7.4.0 and for current master. See attached screenshots for corrected test case: pload MODELING VISUALIZATION vinit View vsetcolorbg 255 255 255 vlight -clear vlight -add ambient vtrihedron t1 -drawAxes XY -arrowColor 0 0 0 -color Whole 0 0 0 -textColor 0 0 0 vdrawtext text1 surprise -pos 100 100 0 -color BLACK -height 20 vdrawtext text2 20.07.2020 -pos 100 -100 0 -color CORNFLOWERBLUE -height 20 vdrawtext text3 surprise -pos -200 100 0 -color BLACK -height 20 -font "Segoe UI" vdrawtext text4 20.07.2020 -pos -200 -100 0 -color CORNFLOWERBLUE -height 20 -font "Segoe UI" vfit vtop vzoom 0.5 |
(0093235) kgv (developer) 2020-07-21 17:55 |
One more option is conditionally enabling hinting for such thin fonts. Currently, hinting is disabled by FT_LOAD_NO_HINTING flag in Font_FTFont constructor, which according to documentation produces blurrier result. This will not produce exactly the same result, but as it makes thin fonts less blurry, the blending with background has smaller effect. |
(0093258) nds (developer) 2020-07-23 11:35 |
Dear Kirill commented flag FT_LOAD_NO_HINTING in Font_FTFont constructor gives better result (see 31678_wi_comparing.png). It would be great if we may set it using some new additional method in OCCT for such parameter. Thank you in advance, Natalia |
(0093273) git (administrator) 2020-07-23 23:12 |
Branch CR31678 has been created by kgv. SHA-1: cb8a329e48d8ec80a141edbee70ac8fa9cb9196b Detailed log of new commits: Author: kgv Date: Thu Jul 23 22:39:27 2020 +0300 0031678: Visualization - add option enabling hinting for textured fonts Added new rendering parameter Graphic3d_RenderingParams::ToEnableFontHinting allowing to enable/disable hinting (default is no hinting preserving old behavior). SelectMgr_ViewerSelector3d::ClearSensitive() - fixed crash on removing presentations. Command vrenderparams has been extended with arguments -fontHinting. In addition, added new parameters -sync and -reset for synchronizing parameters across Views; parameters -raster and -rayTrace now accept optional on|off values. |
(0093274) kgv (developer) 2020-07-23 23:39 edited on: 2020-07-23 23:41 |
Here is an elaboration about font rendering from FreeType developers: https://www.freetype.org/freetype2/docs/text-rendering-general.html [^] > The correct way of rendering a glyph image on a surface > is to alpha blend it onto the surface in linear space > and then apply gamma correction to translate the linear coverage map > to something that is correct for our screens So that current OCCT behavior more or less follows this guidance. Hinting algorithms are expected to improve text readability in general on low-resolution screens (hopefully they will die some time). However, there are a plenty of tricks around hinting (starting from patents, which have been expired circa '2011 according to FreeType). Consider enabling this feature only on non-HiDPI screens at application level. Note that OCCT does not support LCD-antialiasing of fonts (also useful only for low-resolution screens). |
(0093275) kgv (developer) 2020-07-24 01:18 |
Patch is ready for review in OCCT branch CR31678. http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31678-master-KGV [^] |
(0093276) git (administrator) 2020-07-24 02:28 |
Branch CR31678 has been updated by kgv. SHA-1: b0435d5aca1bacd41d22eea0c8d109053becc858 Detailed log of new commits: Author: kgv Date: Fri Jul 24 02:30:05 2020 +0300 # update Font_FTFont::AdvanceX() |
(0093365) git (administrator) 2020-07-25 20:30 |
Branch CR31678 has been updated forcibly by kgv. SHA-1: 12c2257ae5e701c66148e601dbd7325f600d33be |
(0093366) nds (developer) 2020-07-27 08:33 |
Dear Kirill, it would be also useful, if you provide your images with additional information: - Font type, - Font size, - Free Type version. Is it possible to have the same images on light(preferable white) background? Thank you for investigations, Natalia |
![]() |
|||
Date Modified | Username | Field | Change |
2020-07-21 13:35 | nds | New Issue | |
2020-07-21 13:35 | nds | Assigned To | => kgv |
2020-07-21 13:35 | nds | File Added: text_on_occt730.png | |
2020-07-21 13:35 | nds | File Added: text_on_occt_IR-2020-06-19.png | |
2020-07-21 14:03 | kgv | Relationship added | child of 0029528 |
2020-07-21 14:14 | kgv | Note Added: 0093225 | |
2020-07-21 14:15 | kgv | Note Edited: 0093225 | View Revisions |
2020-07-21 14:15 | kgv | Note Edited: 0093225 | View Revisions |
2020-07-21 15:07 | kgv | File Added: text_light_740.png | |
2020-07-21 15:07 | kgv | File Added: text_light_750dev.png | |
2020-07-21 15:08 | kgv | Note Added: 0093229 | |
2020-07-21 15:08 | kgv | Assigned To | kgv => nds |
2020-07-21 15:08 | kgv | Status | new => feedback |
2020-07-21 15:09 | kgv | Note Edited: 0093229 | View Revisions |
2020-07-21 17:50 | kgv | File Added: text_light_750dev_hinted.png | |
2020-07-21 17:55 | kgv | Note Added: 0093235 | |
2020-07-23 11:26 | nds | File Added: 31678_wi_comparing.png | |
2020-07-23 11:35 | nds | Note Added: 0093258 | |
2020-07-23 11:35 | nds | Assigned To | nds => kgv |
2020-07-23 11:35 | nds | Status | feedback => assigned |
2020-07-23 14:08 | kgv | File Added: krita_arrow_sRGB.png | |
2020-07-23 14:08 | kgv | File Added: krita_arrow_scRGB.png | |
2020-07-23 19:56 | kgv | Severity | major => feature |
2020-07-23 19:56 | kgv | Summary | Visualization - text color becomes lighter than in 7.3.0 => Visualization - add option enabling hinting for textured fonts |
2020-07-23 19:57 | kgv | File Added: freetype-27-hinting-comparison.png | |
2020-07-23 23:12 | git | Note Added: 0093273 | |
2020-07-23 23:39 | kgv | Note Added: 0093274 | |
2020-07-23 23:41 | kgv | Note Edited: 0093274 | View Revisions |
2020-07-24 01:18 | kgv | Note Added: 0093275 | |
2020-07-24 01:18 | kgv | Assigned To | kgv => nds |
2020-07-24 01:18 | kgv | Status | assigned => resolved |
2020-07-24 01:48 | kgv | Assigned To | nds => kgv |
2020-07-24 01:48 | kgv | Status | resolved => assigned |
2020-07-24 02:28 | git | Note Added: 0093276 | |
2020-07-25 20:22 | kgv | File Added: a8_windows_nohint.png | |
2020-07-25 20:22 | kgv | File Added: a8_windows_hinted.png | |
2020-07-25 20:22 | kgv | File Added: a8_linux_nohint.png | |
2020-07-25 20:22 | kgv | File Added: a8_linux_hinted.png | |
2020-07-25 20:26 | kgv | File Deleted: a8_linux_hinted.png | |
2020-07-25 20:26 | kgv | File Deleted: a8_linux_nohint.png | |
2020-07-25 20:26 | kgv | File Deleted: a8_windows_nohint.png | |
2020-07-25 20:26 | kgv | File Deleted: a8_windows_hinted.png | |
2020-07-25 20:26 | kgv | File Added: a8_windows_nohint.png | |
2020-07-25 20:26 | kgv | File Added: a8_windows_hinted.png | |
2020-07-25 20:26 | kgv | File Added: a8_linux_nohint.png | |
2020-07-25 20:27 | kgv | File Added: a8_linux_hinted.png | |
2020-07-25 20:30 | git | Note Added: 0093365 | |
2020-07-27 08:33 | nds | Note Added: 0093366 | |
2020-09-21 17:42 | kgv | Target Version | 7.5.0 => 7.6.0* |
Copyright © 2000 - 2021 MantisBT Team |