-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix font axes/features settings UI #17164
Conversation
#include "EnumEntry.h" | ||
#include "ProfileViewModel.h" | ||
|
||
#include "Appearances.g.cpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to the doomsday diff. This was awful to write, so I'm sure it's going to be awful to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand all of this, which is crazy.
doc/cascadia/profiles.schema.json
Outdated
@@ -349,7 +349,7 @@ | |||
"description": "Sets the DWrite font features for the given font. For example, { \"ss01\": 1, \"liga\":0 } will enable ss01 and disable ligatures.", | |||
"type": "object", | |||
"patternProperties": { | |||
"^(([A-Za-z0-9]){4})$": { | |||
"^[\\x00-\\x7E]{4}$": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leonard you're scaring me
are there opentype features that we were excluding from pleasant company?
... should we keep excluding them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When implementing the corresponding C++ code for this, I checked the OpenType and CSS 4 docs. Tags are apparently any 4 letter printable ASCII, so I changed the code and schema accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"printable" would start at \x20
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, I didn't notice that typo at all! Thanks!
@@ -731,6 +731,16 @@ namespace Microsoft::Terminal::Settings::Model::JsonUtils | |||
|
|||
Json::Value ToJson(const float val) | |||
{ | |||
// Convert floats that are almost integers to proper integers, because that looks way neater in JSON. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i really like this
|
||
--*/ | ||
|
||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAHAH line endings strikes again
Can you confirm whether this is correct? UNFORTUNATELY, our repo stores CRLF internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it's the other way around. These files are LF in our repo and I accidentally turned this file into CRLF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased it now with Appearances.{idl,h,cpp}
converted to LF endings.
Edit: No changes https://github.com/microsoft/terminal/compare/41a3df2c03c0a37c8b875396967c0b2142d11d44..0077ed72800e360bdf1500754c0c0257a10f57f5?w=1
void AxisKeyValuePair::AxisIndex(int32_t axisIndex) | ||
// You can't return a const-ref from a WinRT function, because the cppwinrt generated wrapper chokes on it. | ||
// So, now we got two KeyDisplayString() functions, because I refuse to AddRef/Release this for no reason. | ||
// I mean, really it makes no perf. difference, but I'm not kneeling down for an incompetent code generator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mood
41a3df2
to
0077ed7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Played around with it, looks and feels great!
Due to #16821 everything about #16104 broke. This PR rights the wrongs
by rewriting all the
Font
-based code to not useFont
at all.Instead we split the font spec once into font families, do a lot of
complex logic to split font axes/features into used and unused ones
and construct all the UI elements. So. much. boilerplate. code.
Closes #16943
Validation Steps Performed
There are more edge cases than I can list here... Some ideas: