macOS wxNativeFontInfo changes (#2045)

* adding native font descriptor serialization = v2

* remove common xml prefix from serialized string

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* static string via accessor

* striping off xml preamble unconditionally

if we use a different format in the future, we will have to increase our version number

* applying italic directly to the font descriptor

thus preserving attributes in the native font descriptor which we don’t store explicitly yet

* Adding support for preserving font width

Although we don’t express this in the public API yet, we try to preserve eg condensed, when changing the font width

* Adding reference, bug fix

double checked the font weight constants,

Co-authored-by: VZ <vz-github@zeitlins.org>
This commit is contained in:
Stefan Csomor
2020-09-12 19:29:26 +02:00
committed by GitHub
parent 16ab09208f
commit bc9e7b71e7
2 changed files with 165 additions and 69 deletions

View File

@@ -173,6 +173,7 @@ public:
static CGFloat GetCTWeight( CTFontRef font );
static CGFloat GetCTWeight( CTFontDescriptorRef font );
static CGFloat GetCTwidth( CTFontDescriptorRef font );
static CGFloat GetCTSlant( CTFontDescriptorRef font );
CTFontDescriptorRef GetCTFontDescriptor() const;
@@ -182,6 +183,7 @@ private:
// attributes for regenerating a CTFontDescriptor, stay close to native values
// for better roundtrip fidelity
CGFloat m_ctWeight;
CGFloat m_ctWidth;
wxFontStyle m_style;
CGFloat m_ctSize;
wxFontFamily m_family;