Commit 9bf1114d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFontFace4.

parent 1316520a
......@@ -180,7 +180,7 @@ extern HRESULT get_eudc_fontcollection(IDWriteFactory4*,IDWriteFontCollection**)
extern HRESULT get_textanalyzer(IDWriteTextAnalyzer**) DECLSPEC_HIDDEN;
extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN;
extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(const struct fontface_desc*,IDWriteFontFace3**) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(const struct fontface_desc*,IDWriteFontFace4**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory4*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
......@@ -199,7 +199,7 @@ extern HRESULT create_fontfacereference(IDWriteFactory4*,IDWriteFontFile*,UINT32
IDWriteFontFaceReference**) DECLSPEC_HIDDEN;
extern HRESULT factory_get_cached_fontface(IDWriteFactory4*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace**,
struct list**) DECLSPEC_HIDDEN;
extern void factory_cache_fontface(struct list*,IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern void factory_cache_fontface(struct list*,IDWriteFontFace4*) DECLSPEC_HIDDEN;
/* Opentype font table functions */
struct dwrite_font_props {
......@@ -229,7 +229,7 @@ extern UINT32 opentype_get_cpal_palettecount(const void*) DECLSPEC_HIDDEN;
extern UINT32 opentype_get_cpal_paletteentrycount(const void*) DECLSPEC_HIDDEN;
extern HRESULT opentype_get_cpal_entries(const void*,UINT32,UINT32,UINT32,DWRITE_COLOR_F*) DECLSPEC_HIDDEN;
extern HRESULT opentype_get_font_signature(struct file_stream_desc*,FONTSIGNATURE*) DECLSPEC_HIDDEN;
extern BOOL opentype_has_vertical_variants(IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern BOOL opentype_has_vertical_variants(IDWriteFontFace4*) DECLSPEC_HIDDEN;
struct dwrite_colorglyph {
USHORT layer; /* [0, num_layers) index indicating current layer */
......@@ -259,7 +259,7 @@ extern WCHAR bidi_get_mirrored_char(WCHAR) DECLSPEC_HIDDEN;
/* FreeType integration */
struct dwrite_glyphbitmap {
IDWriteFontFace3 *fontface;
IDWriteFontFace4 *fontface;
FLOAT emsize;
BOOL nohint;
UINT16 index;
......@@ -272,19 +272,19 @@ struct dwrite_glyphbitmap {
extern BOOL init_freetype(void) DECLSPEC_HIDDEN;
extern void release_freetype(void) DECLSPEC_HIDDEN;
extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
extern void freetype_notify_cacheremove(IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern BOOL freetype_is_monospaced(IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3*,FLOAT,UINT16 const*,FLOAT const*, DWRITE_GLYPH_OFFSET const*,
extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace4*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
extern void freetype_notify_cacheremove(IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern BOOL freetype_is_monospaced(IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4*,FLOAT,UINT16 const*,FLOAT const*, DWRITE_GLYPH_OFFSET const*,
UINT32,BOOL,IDWriteGeometrySink*) DECLSPEC_HIDDEN;
extern UINT16 freetype_get_glyphcount(IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern void freetype_get_glyphs(IDWriteFontFace3*,INT,UINT32 const*,UINT32,UINT16*) DECLSPEC_HIDDEN;
extern BOOL freetype_has_kerning_pairs(IDWriteFontFace3*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace3*,UINT16,UINT16) DECLSPEC_HIDDEN;
extern UINT16 freetype_get_glyphcount(IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern void freetype_get_glyphs(IDWriteFontFace4*,INT,UINT32 const*,UINT32,UINT16*) DECLSPEC_HIDDEN;
extern BOOL freetype_has_kerning_pairs(IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4*,UINT16,UINT16) DECLSPEC_HIDDEN;
extern void freetype_get_glyph_bbox(struct dwrite_glyphbitmap*) DECLSPEC_HIDDEN;
extern BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap*) DECLSPEC_HIDDEN;
extern INT freetype_get_charmap_index(IDWriteFontFace3*,BOOL*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_glyph_advance(IDWriteFontFace3*,FLOAT,UINT16,DWRITE_MEASURING_MODE) DECLSPEC_HIDDEN;
extern INT freetype_get_charmap_index(IDWriteFontFace4*,BOOL*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_glyph_advance(IDWriteFontFace4*,FLOAT,UINT16,DWRITE_MEASURING_MODE) DECLSPEC_HIDDEN;
/* Glyph shaping */
enum SCRIPT_JUSTIFY
......
......@@ -222,14 +222,14 @@ void release_freetype(void)
pFT_Done_FreeType(library);
}
void freetype_notify_cacheremove(IDWriteFontFace3 *fontface)
void freetype_notify_cacheremove(IDWriteFontFace4 *fontface)
{
EnterCriticalSection(&freetype_cs);
pFTC_Manager_RemoveFaceID(cache_manager, fontface);
LeaveCriticalSection(&freetype_cs);
}
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace4 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
{
FTC_ScalerRec scaler;
FT_Size size;
......@@ -260,7 +260,7 @@ HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 uni
return S_OK;
}
BOOL freetype_is_monospaced(IDWriteFontFace3 *fontface)
BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
{
BOOL is_monospaced = FALSE;
FT_Face face;
......@@ -417,7 +417,7 @@ static void decompose_outline(FT_Outline *outline, FLOAT xoffset, FLOAT yoffset,
ID2D1SimplifiedGeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
}
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
DWRITE_GLYPH_OFFSET const *offsets, UINT32 count, BOOL is_rtl, IDWriteGeometrySink *sink)
{
FTC_ScalerRec scaler;
......@@ -430,7 +430,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize,
ID2D1SimplifiedGeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
simulations = IDWriteFontFace3_GetSimulations(fontface);
simulations = IDWriteFontFace4_GetSimulations(fontface);
scaler.face_id = fontface;
scaler.width = emSize;
......@@ -485,7 +485,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize,
return hr;
}
UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
UINT16 freetype_get_glyphcount(IDWriteFontFace4 *fontface)
{
UINT16 count = 0;
FT_Face face;
......@@ -498,7 +498,7 @@ UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
return count;
}
void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
void freetype_get_glyphs(IDWriteFontFace4 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
UINT32 i;
......@@ -519,7 +519,7 @@ void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *
LeaveCriticalSection(&freetype_cs);
}
BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
BOOL freetype_has_kerning_pairs(IDWriteFontFace4 *fontface)
{
BOOL has_kerning_pairs = FALSE;
FT_Face face;
......@@ -532,7 +532,7 @@ BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
return has_kerning_pairs;
}
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace3 *fontface, UINT16 left, UINT16 right)
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4 *fontface, UINT16 left, UINT16 right)
{
INT32 adjustment = 0;
FT_Face face;
......@@ -559,7 +559,7 @@ static inline void ft_matrix_from_dwrite_matrix(const DWRITE_MATRIX *m, FT_Matri
}
/* Should be used only while holding 'freetype_cs' */
static BOOL is_face_scalable(IDWriteFontFace3 *fontface)
static BOOL is_face_scalable(IDWriteFontFace4 *fontface)
{
FT_Face face;
if (pFTC_Manager_LookupFace(cache_manager, fontface, &face) == 0)
......@@ -749,7 +749,7 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return ret;
}
INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
INT freetype_get_charmap_index(IDWriteFontFace4 *fontface, BOOL *is_symbol)
{
INT charmap_index = -1;
FT_Face face;
......@@ -781,7 +781,7 @@ INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
return charmap_index;
}
INT32 freetype_get_glyph_advance(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
INT32 freetype_get_glyph_advance(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
{
FTC_ImageTypeRec imagetype;
FT_Glyph glyph;
......@@ -815,43 +815,43 @@ void release_freetype(void)
{
}
void freetype_notify_cacheremove(IDWriteFontFace3 *fontface)
void freetype_notify_cacheremove(IDWriteFontFace4 *fontface)
{
}
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace4 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
{
return E_NOTIMPL;
}
BOOL freetype_is_monospaced(IDWriteFontFace3 *fontface)
BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
{
return FALSE;
}
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
DWRITE_GLYPH_OFFSET const *offsets, UINT32 count, BOOL is_rtl, IDWriteGeometrySink *sink)
{
return E_NOTIMPL;
}
UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
UINT16 freetype_get_glyphcount(IDWriteFontFace4 *fontface)
{
return 0;
}
void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
void freetype_get_glyphs(IDWriteFontFace4 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
memset(glyphs, 0, count * sizeof(*glyphs));
}
BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
BOOL freetype_has_kerning_pairs(IDWriteFontFace4 *fontface)
{
return FALSE;
}
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace3 *fontface, UINT16 left, UINT16 right)
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4 *fontface, UINT16 left, UINT16 right)
{
return 0;
}
......@@ -866,13 +866,13 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return FALSE;
}
INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
INT freetype_get_charmap_index(IDWriteFontFace4 *fontface, BOOL *is_symbol)
{
*is_symbol = FALSE;
return -1;
}
INT32 freetype_get_glyph_advance(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
INT32 freetype_get_glyph_advance(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
{
return 0;
}
......
......@@ -508,7 +508,7 @@ struct collectionloader
struct fontfacecached
{
struct list entry;
IDWriteFontFace3 *fontface;
IDWriteFontFace4 *fontface;
};
struct fileloader
......@@ -544,7 +544,7 @@ static void release_fontface_cache(struct list *fontfaces)
struct fontfacecached *fontface, *fontface2;
LIST_FOR_EACH_ENTRY_SAFE(fontface, fontface2, fontfaces, struct fontfacecached, entry) {
list_remove(&fontface->entry);
IDWriteFontFace3_Release(fontface->fontface);
IDWriteFontFace4_Release(fontface->fontface);
heap_free(fontface);
}
}
......@@ -835,14 +835,14 @@ HRESULT factory_get_cached_fontface(IDWriteFactory4 *iface, IDWriteFontFile * co
const void *cached_key;
IDWriteFontFile *file;
cached_face_index = IDWriteFontFace3_GetIndex(cached->fontface);
cached_simulations = IDWriteFontFace3_GetSimulations(cached->fontface);
cached_face_index = IDWriteFontFace4_GetIndex(cached->fontface);
cached_simulations = IDWriteFontFace4_GetSimulations(cached->fontface);
/* skip earlier */
if (cached_face_index != index || cached_simulations != simulations)
continue;
hr = IDWriteFontFace3_GetFiles(cached->fontface, &count, &file);
hr = IDWriteFontFace4_GetFiles(cached->fontface, &count, &file);
if (FAILED(hr))
return hr;
......@@ -861,7 +861,7 @@ HRESULT factory_get_cached_fontface(IDWriteFactory4 *iface, IDWriteFontFile * co
return S_FALSE;
}
void factory_cache_fontface(struct list *fontfaces, IDWriteFontFace3 *fontface)
void factory_cache_fontface(struct list *fontfaces, IDWriteFontFace4 *fontface)
{
struct fontfacecached *cached;
......@@ -883,7 +883,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory4 *iface,
DWRITE_FONT_FACE_TYPE face_type;
struct fontface_desc desc;
struct list *fontfaces;
IDWriteFontFace3 *face;
IDWriteFontFace4 *face;
BOOL is_supported;
UINT32 count;
HRESULT hr;
......
......@@ -1932,7 +1932,7 @@ HRESULT opentype_get_font_signature(struct file_stream_desc *stream_desc, FONTSI
return hr;
}
BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
BOOL opentype_has_vertical_variants(IDWriteFontFace4 *fontface)
{
const OT_FeatureList *featurelist;
const OT_LookupList *lookup_list;
......@@ -1944,7 +1944,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
HRESULT hr;
UINT16 i;
hr = IDWriteFontFace3_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists);
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists);
if (FAILED(hr) || !exists)
return FALSE;
......@@ -2002,7 +2002,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
}
}
IDWriteFontFace3_ReleaseFontTable(fontface, context);
IDWriteFontFace4_ReleaseFontTable(fontface, context);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment