Fixed the Windows code to run after the recent changes. Now to decide whether to clean it up like we did the OS X code...

This commit is contained in:
Pietro Gagliardi 2017-05-30 16:57:25 -04:00
parent 01df4631f6
commit 81a82723d0
3 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@ static void ensureEffectsInRange(struct foreachParams *p, size_t start, size_t e
} }
} }
static void setFeaturesInRange(struct foreachParams *p, size_t start, size_t end, uiOpenTypeFeatures *otf) static void setFeaturesInRange(struct foreachParams *p, size_t start, size_t end, const uiOpenTypeFeatures *otf)
{ {
IDWriteTypography *dt; IDWriteTypography *dt;
size_t i; size_t i;
@ -89,7 +89,7 @@ static int processAttribute(uiAttributedString *s, uiAttributeSpec *spec, size_t
range.length = end - start; range.length = end - start;
switch (spec->Type) { switch (spec->Type) {
case uiAttributeFamily: case uiAttributeFamily:
wfamily = toUTF16((char *) (spec->Value)); wfamily = toUTF16(spec->Family);
hr = p->layout->SetFontFamilyName(wfamily, range); hr = p->layout->SetFontFamilyName(wfamily, range);
if (hr != S_OK) if (hr != S_OK)
logHRESULT(L"error applying family name attribute", hr); logHRESULT(L"error applying family name attribute", hr);
@ -196,7 +196,7 @@ static int processAttribute(uiAttributedString *s, uiAttributeSpec *spec, size_t
} }
break; break;
case uiAttributeFeatures: case uiAttributeFeatures:
setFeaturesInRange(p, start, end, (uiOpenTypeFeatures *) (spec->Value)); setFeaturesInRange(p, start, end, spec->Features);
break; break;
default: default:
// TODO complain // TODO complain

View File

@ -81,7 +81,7 @@ int uiOpenTypeFeaturesEqual(const uiOpenTypeFeatures *a, const uiOpenTypeFeature
return *(a->tags) == *(b->tags); return *(a->tags) == *(b->tags);
} }
IDWriteTypography *otfToDirectWrite(uiOpenTypeFeatures *otf) IDWriteTypography *otfToDirectWrite(const uiOpenTypeFeatures *otf)
{ {
IDWriteTypography *dt; IDWriteTypography *dt;
tagmap::const_iterator iter, end; tagmap::const_iterator iter, end;

View File

@ -164,4 +164,4 @@ extern ID2D1DCRenderTarget *makeHDCRenderTarget(HDC dc, RECT *r);
extern void fontdescFromIDWriteFont(IDWriteFont *font, uiDrawFontDescriptor *uidesc); extern void fontdescFromIDWriteFont(IDWriteFont *font, uiDrawFontDescriptor *uidesc);
// opentype.cpp // opentype.cpp
extern IDWriteTypography *otfToDirectWrite(uiOpenTypeFeatures *otf); extern IDWriteTypography *otfToDirectWrite(const uiOpenTypeFeatures *otf);