Commit 77c5ed60 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFontFace3.

parent d75991d8
......@@ -131,7 +131,7 @@ extern HRESULT get_eudc_fontcollection(IDWriteFactory2*,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(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2**) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace3**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN;
extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,const DWRITE_MATRIX*,
DWRITE_GRID_FIT_MODE,DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
......@@ -198,7 +198,7 @@ extern WCHAR bidi_get_mirrored_char(WCHAR) DECLSPEC_HIDDEN;
/* FreeType integration */
struct dwrite_glyphbitmap {
IDWriteFontFace2 *fontface;
IDWriteFontFace3 *fontface;
FLOAT emsize;
BOOL nohint;
UINT16 index;
......@@ -211,19 +211,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(IDWriteFontFace2*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
extern void freetype_notify_cacheremove(IDWriteFontFace2*) DECLSPEC_HIDDEN;
extern BOOL freetype_is_monospaced(IDWriteFontFace2*) DECLSPEC_HIDDEN;
extern HRESULT freetype_get_glyphrun_outline(IDWriteFontFace2*,FLOAT,UINT16 const*,FLOAT const*, DWRITE_GLYPH_OFFSET const*,
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*,
UINT32,BOOL,IDWriteGeometrySink*) DECLSPEC_HIDDEN;
extern UINT16 freetype_get_glyphcount(IDWriteFontFace2*) DECLSPEC_HIDDEN;
extern void freetype_get_glyphs(IDWriteFontFace2*,INT,UINT32 const*,UINT32,UINT16*) DECLSPEC_HIDDEN;
extern BOOL freetype_has_kerning_pairs(IDWriteFontFace2*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace2*,UINT16,UINT16) 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 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(IDWriteFontFace2*,BOOL*) DECLSPEC_HIDDEN;
extern INT32 freetype_get_glyph_advance(IDWriteFontFace2*,FLOAT,UINT16,DWRITE_MEASURING_MODE) 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;
/* Glyph shaping */
enum SCRIPT_JUSTIFY
......
......@@ -217,14 +217,14 @@ void release_freetype(void)
pFT_Done_FreeType(library);
}
void freetype_notify_cacheremove(IDWriteFontFace2 *fontface)
void freetype_notify_cacheremove(IDWriteFontFace3 *fontface)
{
EnterCriticalSection(&freetype_cs);
pFTC_Manager_RemoveFaceID(cache_manager, fontface);
LeaveCriticalSection(&freetype_cs);
}
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
{
FTC_ScalerRec scaler;
FT_Size size;
......@@ -255,7 +255,7 @@ HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2 *fontface, UINT16 uni
return S_OK;
}
BOOL freetype_is_monospaced(IDWriteFontFace2 *fontface)
BOOL freetype_is_monospaced(IDWriteFontFace3 *fontface)
{
BOOL is_monospaced = FALSE;
FT_Face face;
......@@ -412,7 +412,7 @@ static void decompose_outline(FT_Outline *outline, FLOAT xoffset, FLOAT yoffset,
ID2D1SimplifiedGeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
}
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
DWRITE_GLYPH_OFFSET const *offsets, UINT32 count, BOOL is_rtl, IDWriteGeometrySink *sink)
{
FTC_ScalerRec scaler;
......@@ -425,7 +425,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace2 *fontface, FLOAT emSize,
ID2D1SimplifiedGeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
simulations = IDWriteFontFace2_GetSimulations(fontface);
simulations = IDWriteFontFace3_GetSimulations(fontface);
scaler.face_id = fontface;
scaler.width = emSize;
......@@ -480,7 +480,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace2 *fontface, FLOAT emSize,
return hr;
}
UINT16 freetype_get_glyphcount(IDWriteFontFace2 *fontface)
UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
{
UINT16 count = 0;
FT_Face face;
......@@ -493,7 +493,7 @@ UINT16 freetype_get_glyphcount(IDWriteFontFace2 *fontface)
return count;
}
void freetype_get_glyphs(IDWriteFontFace2 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
UINT32 i;
......@@ -514,7 +514,7 @@ void freetype_get_glyphs(IDWriteFontFace2 *fontface, INT charmap, UINT32 const *
LeaveCriticalSection(&freetype_cs);
}
BOOL freetype_has_kerning_pairs(IDWriteFontFace2 *fontface)
BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
{
BOOL has_kerning_pairs = FALSE;
FT_Face face;
......@@ -527,7 +527,7 @@ BOOL freetype_has_kerning_pairs(IDWriteFontFace2 *fontface)
return has_kerning_pairs;
}
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace2 *fontface, UINT16 left, UINT16 right)
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace3 *fontface, UINT16 left, UINT16 right)
{
INT32 adjustment = 0;
FT_Face face;
......@@ -554,7 +554,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(IDWriteFontFace2 *fontface)
static BOOL is_face_scalable(IDWriteFontFace3 *fontface)
{
FT_Face face;
if (pFTC_Manager_LookupFace(cache_manager, fontface, &face) == 0)
......@@ -747,7 +747,7 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return ret;
}
INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol)
INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
{
INT charmap_index = -1;
FT_Face face;
......@@ -779,7 +779,7 @@ INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol)
return charmap_index;
}
INT32 freetype_get_glyph_advance(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
INT32 freetype_get_glyph_advance(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
{
FTC_ImageTypeRec imagetype;
FT_Glyph glyph;
......@@ -813,43 +813,43 @@ void release_freetype(void)
{
}
void freetype_notify_cacheremove(IDWriteFontFace2 *fontface)
void freetype_notify_cacheremove(IDWriteFontFace3 *fontface)
{
}
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 unitsperEm, UINT16 glyph, DWRITE_GLYPH_METRICS *ret)
{
return E_NOTIMPL;
}
BOOL freetype_is_monospaced(IDWriteFontFace2 *fontface)
BOOL freetype_is_monospaced(IDWriteFontFace3 *fontface)
{
return FALSE;
}
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 const *glyphs, FLOAT const *advances,
HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *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(IDWriteFontFace2 *fontface)
UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
{
return 0;
}
void freetype_get_glyphs(IDWriteFontFace2 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
memset(glyphs, 0, count * sizeof(*glyphs));
}
BOOL freetype_has_kerning_pairs(IDWriteFontFace2 *fontface)
BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
{
return FALSE;
}
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace2 *fontface, UINT16 left, UINT16 right)
INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace3 *fontface, UINT16 left, UINT16 right)
{
return 0;
}
......@@ -864,13 +864,13 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return FALSE;
}
INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol)
INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
{
*is_symbol = FALSE;
return -1;
}
INT32 freetype_get_glyph_advance(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
INT32 freetype_get_glyph_advance(IDWriteFontFace3 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode)
{
return 0;
}
......
......@@ -806,7 +806,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory2 *iface,
IDWriteFontFileLoader *loader;
struct fontfacecached *cached;
struct list *fontfaces;
IDWriteFontFace2 *face;
IDWriteFontFace3 *face;
UINT32 key_size, count;
BOOL is_supported;
const void *key;
......@@ -893,7 +893,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory2 *iface,
/* new cache entry */
cached = heap_alloc(sizeof(*cached));
if (!cached) {
IDWriteFontFace2_Release(face);
IDWriteFontFace3_Release(face);
return hr;
}
......
......@@ -183,7 +183,7 @@ interface IDWriteFontFace3 : IDWriteFontFace2
BOOL IsGlyphLocal(UINT16 glyph);
HRESULT AreCharactersLocal(WCHAR const *characters,
UINT32 count, BOOL enqueue_if_not, BOOL *are_local);
HRESULT AreGlyphsLocal(UINT16 *const glyphs, UINT32 count,
HRESULT AreGlyphsLocal(UINT16 const *glyphs, UINT32 count,
BOOL enqueue_if_not, BOOL *are_local);
}
......
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