Repository navigation
AtlasEngine: Implement ClearType blending - #12242
4 commits merged into
Conversation
f4e32c9 to
ce0f6c6
Compare
ce0f6c6 to
27dc7e3
Compare
|
looks good, with a dash of "well, why not?" |
Michael Niksa (miniksa)
left a comment
There was a problem hiding this comment.
Very excited for this!
| /* pSrcData */ dataBeg.get(), | ||
| /* SrcDataSize */ fileSize, | ||
| /* pFileName */ nullptr, | ||
| const auto hr = D3DCompileFromFile( |
There was a problem hiding this comment.
Well that seems obvious in hindsight.
| // The history of these fonts is interesting. The glyph outlines were originally created by digitizing the typeballs of | ||
| // IBM Selectric typewriters. Digitizing the metal typeballs yielded very precise outlines. However, the strokes are | ||
| // consistently too thin in comparison with the corresponding typewritten characters because the thickness of the | ||
| // typewriter ribbon was not accounted for. This didn't matter in the earliest versions of Windows because the screen | ||
| // resolution was not that high and you could not have a stroke thinner than one pixel. However, with the introduction | ||
| // of anti-aliasing the thin strokes manifested in text that was too light. By this time, it was too late to change | ||
| // the fonts so instead a special case was added to render these fonts differently. |
There was a problem hiding this comment.
Fascinating!
| for (const auto familyName : thinFontFamilyNames) | ||
| { | ||
| n = wcscmp(canonicalFamilyName, familyName); | ||
| if (n <= 0) |
There was a problem hiding this comment.
The trickery of the negative here isn't immediately comprehensible to me. Explain (in a comment)?
There was a problem hiding this comment.
wcscmp, just like other cmp functions (memcmp), returns -1 if the first argument has a character of smaller numeric value than the second argument. wcscmp(L"foo", L"foz") returns -1.
Due to this reason, this loop acts like a call to std::lower_bound, but with linear search, because binary search is kinda overkill for just a few values (log2(x) is close to linear for small x, resulting in 2.6 comparisons with binary search and 3 comparisons with linear search on average here).
I can comment it, but I think a long comment would be boring, since the loop cannot be meaningfully improved, unless it's entirely rewritten from scratch (and I can't think of a short comment either atm 🤔).
There was a problem hiding this comment.
Right... I added a comment explaining the "why" instead of the "how". That seems the most helpful to me. 🙂
| </ItemGroup> | ||
| <ItemGroup> | ||
| <FxCompile Include="dwrite.hlsl"> | ||
| <ExcludedFromBuild>true</ExcludedFromBuild> |
There was a problem hiding this comment.
Wait, why excluded? You don't want it precompiled?
There was a problem hiding this comment.
No, because it's #included from the shader.hlsl file already.
|
Hello Leonard Hecker (@lhecker)! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
Did we just re-break cleartype with a BG? I just merged main in and suddenly: "profiles":
{
"defaults":
{
"adjustIndistinguishableColors": false,
"antialiasingMode": "cleartype",
"closeOnExit": "graceful",
"colorScheme": "Solarized Light",
"experimental.useAtlasEngine": true,
"icon": "d:\\dev\\private\\OpenConsole\\res\\terminal.ico",
"useAcrylic": true,
"bellSound": [
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk1.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk2.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk3.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk4.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk-muffled1.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk-muffled2.mp3",
"C:\\Users\\migrie\\Downloads\\memes\\honks\\Honk-muffled3.mp3"
]
},
...
{
"background": "#416E49",
"backgroundImage": "C:\\Users\\migrie\\Downloads\\memes\\goose.gif",
"backgroundImageAlignment": "bottomRight",
"backgroundImageStretchMode": "none",
"colorScheme": "One Half Dark",
"commandline": "wsl.exe",
"font":
{
"size": 14
},
"bellSound": null,
"guid": "{c756bf8b-2671-54d8-a600-b310c233456b}",
"hidden": false,
"name": "HONK",
"useAcrylic": false
},sorry quick notes before I log off. |

This commit extracts DirectWrite related shader code into dwrite.hlsl
and adds support for ClearType blending.
Additionally the following changes are piggybacked into this commit:
this is already accomplished by
CreateTextLayoutinternallypFileNameparameter was missing
the line gap from 1:1 to 3:1
Part of #9999.
PR Checklist
Validation Steps Performed