implement gdi text renderer
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
9a29682915
commit
8ebc8108ed
20 changed files with 16827 additions and 16830 deletions
|
|
@ -52,6 +52,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
|
|||
option(MW_USE_DIRECTWRITE "Use DirectWrite" OFF)
|
||||
endif()
|
||||
endif()
|
||||
option(MW_USE_GDI_TEXT "Use GDI for text rendering" ON)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux OR ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
|
||||
|
|
@ -171,6 +172,14 @@ if(MW_USE_DIRECTWRITE)
|
|||
)
|
||||
endif()
|
||||
|
||||
if(MW_USE_GDI_TEXT)
|
||||
target_compile_definitions(
|
||||
Mw
|
||||
PRIVATE
|
||||
USE_GDI_TEXT
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MW_USE_WAYLAND)
|
||||
function(scan_wayland_protocol_core)
|
||||
execute_process(
|
||||
|
|
|
|||
|
|
@ -339,13 +339,16 @@ MWDECL void (*MwLLClip)(MwLL handle, MwRect* rect);
|
|||
MWDECL void MwFLSetup(void);
|
||||
|
||||
#ifdef USE_FREETYPE2
|
||||
MWDECL int MWFL_FT2Setup(void);
|
||||
MWDECL int MwFL_FT2Setup(void);
|
||||
#endif
|
||||
#ifdef USE_STB_TRUETYPE
|
||||
MWDECL int MwFL_STBTTSetup(void);
|
||||
#endif
|
||||
#ifdef USE_DIRECTWRITE
|
||||
MWDECL int MWFL_DWSetup(void);
|
||||
MWDECL int MwFL_DWSetup(void);
|
||||
#endif
|
||||
#ifdef USE_GDI_TEXT
|
||||
MWDECL int MwFL_GDISetup(void);
|
||||
#endif
|
||||
|
||||
MWDECL int (*MwFLDrawText)(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, MwLLColor color);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <Mw/String.h>
|
||||
#include <Mw/Draw.h>
|
||||
#include <Mw/Version.h>
|
||||
#include <Mw/TrueType.h>
|
||||
|
||||
#include <Mw/Abstract/Dynamic.h>
|
||||
#include <Mw/Abstract/Directory.h>
|
||||
|
|
|
|||
33
include/Mw/TrueType.h
Normal file
33
include/Mw/TrueType.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*!
|
||||
* @file Mw/TrueType.h
|
||||
* @brief TrueType utilities
|
||||
*/
|
||||
#ifndef __MW_TRUETYPE_H__
|
||||
#define __MW_TRUETYPE_H__
|
||||
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* @brief Get the TrueType font information
|
||||
* @param data Font data
|
||||
* @param size Font size
|
||||
* @return Information
|
||||
*/
|
||||
MWDECL MwTTFInfo MwTTFGetInfo(unsigned char* data, int size);
|
||||
|
||||
/*!
|
||||
* @brief Free the TrueType font information
|
||||
* @brief info Information
|
||||
*/
|
||||
MWDECL void MwTTFFreeInfo(MwTTFInfo info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -31,6 +31,7 @@ typedef struct _MwSubWindow* MwSubWindow;
|
|||
typedef struct _MwTab* MwTab;
|
||||
typedef struct _MwTable* MwTable;
|
||||
typedef struct _MwMouse MwMouse;
|
||||
typedef struct _MwTTFInfo* MwTTFInfo;
|
||||
#ifdef _MILSKO
|
||||
typedef struct _MwWidget* MwWidget;
|
||||
#else
|
||||
|
|
@ -247,6 +248,11 @@ struct _MwMouse {
|
|||
int button;
|
||||
};
|
||||
|
||||
struct _MwTTFInfo {
|
||||
char* family;
|
||||
int weight;
|
||||
};
|
||||
|
||||
struct _MwClass {
|
||||
MwHandlerWithStatus create;
|
||||
MwHandler destroy;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ MwInline void MwWindowMakeBorderless(MwWidget handle, int toggle) {
|
|||
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @brief Whether the window should close
|
||||
* @param handle Widget
|
||||
|
|
@ -39,7 +38,6 @@ MwInline MwBool MwWindowShouldClose(MwWidget handle) {
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ char* MwUTF8ToACP(const char* input) {
|
|||
return MwStringDuplicate(input);
|
||||
}
|
||||
|
||||
wout = malloc(wbytes);
|
||||
wout = malloc(wbytes + sizeof(wchar_t));
|
||||
len = wbytes / sizeof(wchar_t);
|
||||
|
||||
memset(wout, 0, wbytes);
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ static CustomTextRenderer* CustomTextRenderer_Create(IDWriteFactory6* write_fact
|
|||
return obj;
|
||||
}
|
||||
|
||||
int MWFL_DWSetup(void) {
|
||||
int MwFL_DWSetup(void) {
|
||||
HRESULT hr;
|
||||
HANDLE ole32lib;
|
||||
/* CoInitialize, to my knowledge, is avaliable on every Windows version we actually support. But as of writing, CI fails because a specific mingw won't link to it by default. I'm not gonna waste my time chancing that it will properly link to ole32 either. */
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include <ole2.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __dwrite_h__
|
||||
#define __dwrite_h__
|
||||
|
||||
|
|
@ -743,8 +742,7 @@ typedef struct DWRITE_SHAPING_GLYPH_PROPERTIES {
|
|||
DEFINE_GUID(IID_IDWriteFontFileStream, 0x6d4865fe, 0x0ab8, 0x4d91, 0x8f, 0x62, 0x5d, 0xd6, 0xbe, 0x34, 0xa3, 0xe0);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0")
|
||||
IDWriteFontFileStream : public IUnknown
|
||||
{
|
||||
IDWriteFontFileStream : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadFileFragment(
|
||||
const void** fragment_start,
|
||||
UINT64 offset,
|
||||
|
|
@ -759,7 +757,6 @@ IDWriteFontFileStream : public IUnknown
|
|||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetLastWriteTime(
|
||||
UINT64 * last_writetime) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFileStream, 0x6d4865fe, 0x0ab8, 0x4d91, 0x8f, 0x62, 0x5d, 0xd6, 0xbe, 0x34, 0xa3, 0xe0)
|
||||
|
|
@ -847,7 +844,6 @@ static inline HRESULT IDWriteFontFileStream_GetLastWriteTime(IDWriteFontFileStre
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFileStream_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -859,13 +855,11 @@ static inline HRESULT IDWriteFontFileStream_GetLastWriteTime(IDWriteFontFileStre
|
|||
DEFINE_GUID(IID_IDWriteFontFileLoader, 0x727cad4e, 0xd6af, 0x4c9e, 0x8a, 0x08, 0xd6, 0x95, 0xb1, 0x1c, 0xaa, 0x49);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49")
|
||||
IDWriteFontFileLoader : public IUnknown
|
||||
{
|
||||
IDWriteFontFileLoader : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey(
|
||||
const void* key,
|
||||
UINT32 key_size,
|
||||
IDWriteFontFileStream** stream) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFileLoader, 0x727cad4e, 0xd6af, 0x4c9e, 0x8a, 0x08, 0xd6, 0x95, 0xb1, 0x1c, 0xaa, 0x49)
|
||||
|
|
@ -928,7 +922,6 @@ static inline HRESULT IDWriteFontFileLoader_CreateStreamFromKey(IDWriteFontFileL
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFileLoader_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -940,8 +933,7 @@ static inline HRESULT IDWriteFontFileLoader_CreateStreamFromKey(IDWriteFontFileL
|
|||
DEFINE_GUID(IID_IDWriteLocalFontFileLoader, 0xb2d9f3ec, 0xc9fe, 0x4a11, 0xa2, 0xec, 0xd8, 0x62, 0x08, 0xf7, 0xc0, 0xa2);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2")
|
||||
IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
|
||||
{
|
||||
IDWriteLocalFontFileLoader : public IDWriteFontFileLoader {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFilePathLengthFromKey(
|
||||
const void* key,
|
||||
UINT32 key_size,
|
||||
|
|
@ -957,7 +949,6 @@ IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
|
|||
const void* key,
|
||||
UINT32 key_size,
|
||||
FILETIME* writetime) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteLocalFontFileLoader, 0xb2d9f3ec, 0xc9fe, 0x4a11, 0xa2, 0xec, 0xd8, 0x62, 0x08, 0xf7, 0xc0, 0xa2)
|
||||
|
|
@ -1054,7 +1045,6 @@ static inline HRESULT IDWriteLocalFontFileLoader_GetLastWriteTimeFromKey(IDWrite
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteLocalFontFileLoader_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1066,8 +1056,7 @@ static inline HRESULT IDWriteLocalFontFileLoader_GetLastWriteTimeFromKey(IDWrite
|
|||
DEFINE_GUID(IID_IDWriteFontFile, 0x739d886a, 0xcef5, 0x47dc, 0x87, 0x69, 0x1a, 0x8b, 0x41, 0xbe, 0xbb, 0xb0);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0")
|
||||
IDWriteFontFile : public IUnknown
|
||||
{
|
||||
IDWriteFontFile : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetReferenceKey(
|
||||
const void** key,
|
||||
UINT32* key_size) = 0;
|
||||
|
|
@ -1080,7 +1069,6 @@ IDWriteFontFile : public IUnknown
|
|||
DWRITE_FONT_FILE_TYPE * file_type,
|
||||
DWRITE_FONT_FACE_TYPE * face_type,
|
||||
UINT32 * faces_num) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFile, 0x739d886a, 0xcef5, 0x47dc, 0x87, 0x69, 0x1a, 0x8b, 0x41, 0xbe, 0xbb, 0xb0)
|
||||
|
|
@ -1161,7 +1149,6 @@ static inline HRESULT IDWriteFontFile_Analyze(IDWriteFontFile* This,WINBOOL *is_
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFile_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1173,14 +1160,12 @@ static inline HRESULT IDWriteFontFile_Analyze(IDWriteFontFile* This,WINBOOL *is_
|
|||
DEFINE_GUID(IID_IDWriteFontFileEnumerator, 0x72755049, 0x5ff7, 0x435d, 0x83, 0x48, 0x4b, 0xe9, 0x7c, 0xfa, 0x6c, 0x7c);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c")
|
||||
IDWriteFontFileEnumerator : public IUnknown
|
||||
{
|
||||
IDWriteFontFileEnumerator : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE MoveNext(
|
||||
WINBOOL * has_current_file) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetCurrentFontFile(
|
||||
IDWriteFontFile * *font_file) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFileEnumerator, 0x72755049, 0x5ff7, 0x435d, 0x83, 0x48, 0x4b, 0xe9, 0x7c, 0xfa, 0x6c, 0x7c)
|
||||
|
|
@ -1249,7 +1234,6 @@ static inline HRESULT IDWriteFontFileEnumerator_GetCurrentFontFile(IDWriteFontFi
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFileEnumerator_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1261,14 +1245,12 @@ static inline HRESULT IDWriteFontFileEnumerator_GetCurrentFontFile(IDWriteFontFi
|
|||
DEFINE_GUID(IID_IDWriteFontCollectionLoader, 0xcca920e4, 0x52f0, 0x492b, 0xbf, 0xa8, 0x29, 0xc7, 0x2e, 0xe0, 0xa4, 0x68);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468")
|
||||
IDWriteFontCollectionLoader : public IUnknown
|
||||
{
|
||||
IDWriteFontCollectionLoader : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateEnumeratorFromKey(
|
||||
IDWriteFactory * factory,
|
||||
const void* key,
|
||||
UINT32 key_size,
|
||||
IDWriteFontFileEnumerator** enumerator) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontCollectionLoader, 0xcca920e4, 0x52f0, 0x492b, 0xbf, 0xa8, 0x29, 0xc7, 0x2e, 0xe0, 0xa4, 0x68)
|
||||
|
|
@ -1332,7 +1314,6 @@ static inline HRESULT IDWriteFontCollectionLoader_CreateEnumeratorFromKey(IDWrit
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontCollectionLoader_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1344,10 +1325,8 @@ static inline HRESULT IDWriteFontCollectionLoader_CreateEnumeratorFromKey(IDWrit
|
|||
DEFINE_GUID(IID_IDWriteLocalizedStrings, 0x08256209, 0x099a, 0x4b34, 0xb8, 0x6d, 0xc2, 0x2b, 0x11, 0x0e, 0x77, 0x71);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771")
|
||||
IDWriteLocalizedStrings : public IUnknown
|
||||
{
|
||||
virtual UINT32 STDMETHODCALLTYPE GetCount(
|
||||
) = 0;
|
||||
IDWriteLocalizedStrings : public IUnknown {
|
||||
virtual UINT32 STDMETHODCALLTYPE GetCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE FindLocaleName(
|
||||
const WCHAR* locale_name,
|
||||
|
|
@ -1371,7 +1350,6 @@ IDWriteLocalizedStrings : public IUnknown
|
|||
UINT32 index,
|
||||
WCHAR * buffer,
|
||||
UINT32 size) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteLocalizedStrings, 0x08256209, 0x099a, 0x4b34, 0xb8, 0x6d, 0xc2, 0x2b, 0x11, 0x0e, 0x77, 0x71)
|
||||
|
|
@ -1479,7 +1457,6 @@ static inline HRESULT IDWriteLocalizedStrings_GetString(IDWriteLocalizedStrings*
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteLocalizedStrings_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1491,23 +1468,16 @@ static inline HRESULT IDWriteLocalizedStrings_GetString(IDWriteLocalizedStrings*
|
|||
DEFINE_GUID(IID_IDWriteRenderingParams, 0x2f0da53a, 0x2add, 0x47cd, 0x82, 0xee, 0xd9, 0xec, 0x34, 0x68, 0x8e, 0x75);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75")
|
||||
IDWriteRenderingParams : public IUnknown
|
||||
{
|
||||
virtual FLOAT STDMETHODCALLTYPE GetGamma(
|
||||
) = 0;
|
||||
IDWriteRenderingParams : public IUnknown {
|
||||
virtual FLOAT STDMETHODCALLTYPE GetGamma() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetEnhancedContrast(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetEnhancedContrast() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetClearTypeLevel(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetClearTypeLevel() = 0;
|
||||
|
||||
virtual DWRITE_PIXEL_GEOMETRY STDMETHODCALLTYPE GetPixelGeometry(
|
||||
) = 0;
|
||||
|
||||
virtual DWRITE_RENDERING_MODE STDMETHODCALLTYPE GetRenderingMode(
|
||||
) = 0;
|
||||
virtual DWRITE_PIXEL_GEOMETRY STDMETHODCALLTYPE GetPixelGeometry() = 0;
|
||||
|
||||
virtual DWRITE_RENDERING_MODE STDMETHODCALLTYPE GetRenderingMode() = 0;
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteRenderingParams, 0x2f0da53a, 0x2add, 0x47cd, 0x82, 0xee, 0xd9, 0xec, 0x34, 0x68, 0x8e, 0x75)
|
||||
|
|
@ -1595,7 +1565,6 @@ static inline DWRITE_RENDERING_MODE IDWriteRenderingParams_GetRenderingMode(IDWr
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteRenderingParams_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1607,29 +1576,23 @@ static inline DWRITE_RENDERING_MODE IDWriteRenderingParams_GetRenderingMode(IDWr
|
|||
DEFINE_GUID(IID_IDWriteFontFace, 0x5f49804d, 0x7024, 0x4d43, 0xbf, 0xa9, 0xd2, 0x59, 0x84, 0xf5, 0x38, 0x49);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849")
|
||||
IDWriteFontFace : public IUnknown
|
||||
{
|
||||
virtual DWRITE_FONT_FACE_TYPE STDMETHODCALLTYPE GetType(
|
||||
) = 0;
|
||||
IDWriteFontFace : public IUnknown {
|
||||
virtual DWRITE_FONT_FACE_TYPE STDMETHODCALLTYPE GetType() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFiles(
|
||||
UINT32 * number_of_files,
|
||||
IDWriteFontFile * *fontfiles) = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetIndex(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetIndex() = 0;
|
||||
|
||||
virtual DWRITE_FONT_SIMULATIONS STDMETHODCALLTYPE GetSimulations(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_SIMULATIONS STDMETHODCALLTYPE GetSimulations() = 0;
|
||||
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsSymbolFont(
|
||||
) = 0;
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsSymbolFont() = 0;
|
||||
|
||||
virtual void STDMETHODCALLTYPE GetMetrics(
|
||||
DWRITE_FONT_METRICS * metrics) = 0;
|
||||
|
||||
virtual UINT16 STDMETHODCALLTYPE GetGlyphCount(
|
||||
) = 0;
|
||||
virtual UINT16 STDMETHODCALLTYPE GetGlyphCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDesignGlyphMetrics(
|
||||
const UINT16* glyph_indices,
|
||||
|
|
@ -1684,7 +1647,6 @@ IDWriteFontFace : public IUnknown
|
|||
UINT32 glyph_count,
|
||||
DWRITE_GLYPH_METRICS* metrics,
|
||||
WINBOOL is_sideways = FALSE) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFace, 0x5f49804d, 0x7024, 0x4d43, 0xbf, 0xa9, 0xd2, 0x59, 0x84, 0xf5, 0x38, 0x49)
|
||||
|
|
@ -1883,7 +1845,6 @@ static inline HRESULT IDWriteFontFace_GetGdiCompatibleGlyphMetrics(IDWriteFontFa
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFace_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1895,22 +1856,17 @@ static inline HRESULT IDWriteFontFace_GetGdiCompatibleGlyphMetrics(IDWriteFontFa
|
|||
DEFINE_GUID(IID_IDWriteFont, 0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x37);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737")
|
||||
IDWriteFont : public IUnknown
|
||||
{
|
||||
IDWriteFont : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFamily(
|
||||
IDWriteFontFamily * *family) = 0;
|
||||
|
||||
virtual DWRITE_FONT_WEIGHT STDMETHODCALLTYPE GetWeight(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_WEIGHT STDMETHODCALLTYPE GetWeight() = 0;
|
||||
|
||||
virtual DWRITE_FONT_STRETCH STDMETHODCALLTYPE GetStretch(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_STRETCH STDMETHODCALLTYPE GetStretch() = 0;
|
||||
|
||||
virtual DWRITE_FONT_STYLE STDMETHODCALLTYPE GetStyle(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_STYLE STDMETHODCALLTYPE GetStyle() = 0;
|
||||
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsSymbolFont(
|
||||
) = 0;
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsSymbolFont() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFaceNames(
|
||||
IDWriteLocalizedStrings * *names) = 0;
|
||||
|
|
@ -1920,8 +1876,7 @@ IDWriteFont : public IUnknown
|
|||
IDWriteLocalizedStrings * *strings,
|
||||
WINBOOL * exists) = 0;
|
||||
|
||||
virtual DWRITE_FONT_SIMULATIONS STDMETHODCALLTYPE GetSimulations(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_SIMULATIONS STDMETHODCALLTYPE GetSimulations() = 0;
|
||||
|
||||
virtual void STDMETHODCALLTYPE GetMetrics(
|
||||
DWRITE_FONT_METRICS * metrics) = 0;
|
||||
|
|
@ -1932,7 +1887,6 @@ IDWriteFont : public IUnknown
|
|||
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateFontFace(
|
||||
IDWriteFontFace * *face) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFont, 0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x37)
|
||||
|
|
@ -2071,7 +2025,6 @@ static inline HRESULT IDWriteFont_CreateFontFace(IDWriteFont* This,IDWriteFontFa
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFont_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2083,18 +2036,15 @@ static inline HRESULT IDWriteFont_CreateFontFace(IDWriteFont* This,IDWriteFontFa
|
|||
DEFINE_GUID(IID_IDWriteFontList, 0x1a0d8438, 0x1d97, 0x4ec1, 0xae, 0xf9, 0xa2, 0xfb, 0x86, 0xed, 0x6a, 0xcb);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb")
|
||||
IDWriteFontList : public IUnknown
|
||||
{
|
||||
IDWriteFontList : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontCollection(
|
||||
IDWriteFontCollection * *collection) = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontCount(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFont(
|
||||
UINT32 index,
|
||||
IDWriteFont * *font) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontList, 0x1a0d8438, 0x1d97, 0x4ec1, 0xae, 0xf9, 0xa2, 0xfb, 0x86, 0xed, 0x6a, 0xcb)
|
||||
|
|
@ -2171,7 +2121,6 @@ static inline HRESULT IDWriteFontList_GetFont(IDWriteFontList* This,UINT32 index
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontList_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2183,8 +2132,7 @@ static inline HRESULT IDWriteFontList_GetFont(IDWriteFontList* This,UINT32 index
|
|||
DEFINE_GUID(IID_IDWriteFontFamily, 0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdd);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add")
|
||||
IDWriteFontFamily : public IDWriteFontList
|
||||
{
|
||||
IDWriteFontFamily : public IDWriteFontList {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFamilyNames(
|
||||
IDWriteLocalizedStrings * *names) = 0;
|
||||
|
||||
|
|
@ -2199,7 +2147,6 @@ IDWriteFontFamily : public IDWriteFontList
|
|||
DWRITE_FONT_STRETCH stretch,
|
||||
DWRITE_FONT_STYLE style,
|
||||
IDWriteFontList * *fonts) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFamily, 0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdd)
|
||||
|
|
@ -2309,7 +2256,6 @@ static inline HRESULT IDWriteFontFamily_GetMatchingFonts(IDWriteFontFamily* This
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFamily_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2321,10 +2267,8 @@ static inline HRESULT IDWriteFontFamily_GetMatchingFonts(IDWriteFontFamily* This
|
|||
DEFINE_GUID(IID_IDWriteFontCollection, 0xa84cee02, 0x3eea, 0x4eee, 0xa8, 0x27, 0x87, 0xc1, 0xa0, 0x2a, 0x0f, 0xcc);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc")
|
||||
IDWriteFontCollection : public IUnknown
|
||||
{
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFamilyCount(
|
||||
) = 0;
|
||||
IDWriteFontCollection : public IUnknown {
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFamilyCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFamily(
|
||||
UINT32 index,
|
||||
|
|
@ -2338,7 +2282,6 @@ IDWriteFontCollection : public IUnknown
|
|||
virtual HRESULT STDMETHODCALLTYPE GetFontFromFontFace(
|
||||
IDWriteFontFace * face,
|
||||
IDWriteFont * *font) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontCollection, 0xa84cee02, 0x3eea, 0x4eee, 0xa8, 0x27, 0x87, 0xc1, 0xa0, 0x2a, 0x0f, 0xcc)
|
||||
|
|
@ -2426,7 +2369,6 @@ static inline HRESULT IDWriteFontCollection_GetFontFromFontFace(IDWriteFontColle
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontCollection_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2438,8 +2380,7 @@ static inline HRESULT IDWriteFontCollection_GetFontFromFontFace(IDWriteFontColle
|
|||
DEFINE_GUID(IID_IDWritePixelSnapping, 0xeaf3a2da, 0xecf4, 0x4d24, 0xb6, 0x44, 0xb3, 0x4f, 0x68, 0x42, 0x02, 0x4b);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b")
|
||||
IDWritePixelSnapping : public IUnknown
|
||||
{
|
||||
IDWritePixelSnapping : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE IsPixelSnappingDisabled(
|
||||
void* client_drawingcontext,
|
||||
WINBOOL* disabled) = 0;
|
||||
|
|
@ -2451,7 +2392,6 @@ IDWritePixelSnapping : public IUnknown
|
|||
virtual HRESULT STDMETHODCALLTYPE GetPixelsPerDip(
|
||||
void* client_drawingcontext,
|
||||
FLOAT* pixels_per_dip) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWritePixelSnapping, 0xeaf3a2da, 0xecf4, 0x4d24, 0xb6, 0x44, 0xb3, 0x4f, 0x68, 0x42, 0x02, 0x4b)
|
||||
|
|
@ -2531,7 +2471,6 @@ static inline HRESULT IDWritePixelSnapping_GetPixelsPerDip(IDWritePixelSnapping*
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWritePixelSnapping_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2543,8 +2482,7 @@ static inline HRESULT IDWritePixelSnapping_GetPixelsPerDip(IDWritePixelSnapping*
|
|||
DEFINE_GUID(IID_IDWriteTextRenderer, 0xef8a8135, 0x5cc6, 0x45fe, 0x88, 0x25, 0xc5, 0xa0, 0x72, 0x4e, 0xb8, 0x19);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819")
|
||||
IDWriteTextRenderer : public IDWritePixelSnapping
|
||||
{
|
||||
IDWriteTextRenderer : public IDWritePixelSnapping {
|
||||
virtual HRESULT STDMETHODCALLTYPE DrawGlyphRun(
|
||||
void* client_drawingcontext,
|
||||
FLOAT baselineOriginX,
|
||||
|
|
@ -2576,7 +2514,6 @@ IDWriteTextRenderer : public IDWritePixelSnapping
|
|||
WINBOOL is_sideways,
|
||||
WINBOOL is_rtl,
|
||||
IUnknown* drawing_effect) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextRenderer, 0xef8a8135, 0x5cc6, 0x45fe, 0x88, 0x25, 0xc5, 0xa0, 0x72, 0x4e, 0xb8, 0x19)
|
||||
|
|
@ -2711,7 +2648,6 @@ static inline HRESULT IDWriteTextRenderer_DrawInlineObject(IDWriteTextRenderer*
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextRenderer_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2723,8 +2659,7 @@ static inline HRESULT IDWriteTextRenderer_DrawInlineObject(IDWriteTextRenderer*
|
|||
DEFINE_GUID(IID_IDWriteInlineObject, 0x8339fde3, 0x106f, 0x47ab, 0x83, 0x73, 0x1c, 0x62, 0x95, 0xeb, 0x10, 0xb3);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("8339fde3-106f-47ab-8373-1c6295eb10b3")
|
||||
IDWriteInlineObject : public IUnknown
|
||||
{
|
||||
IDWriteInlineObject : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE Draw(
|
||||
void* client_drawingontext,
|
||||
IDWriteTextRenderer* renderer,
|
||||
|
|
@ -2743,7 +2678,6 @@ IDWriteInlineObject : public IUnknown
|
|||
virtual HRESULT STDMETHODCALLTYPE GetBreakConditions(
|
||||
DWRITE_BREAK_CONDITION * condition_before,
|
||||
DWRITE_BREAK_CONDITION * condition_after) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteInlineObject, 0x8339fde3, 0x106f, 0x47ab, 0x83, 0x73, 0x1c, 0x62, 0x95, 0xeb, 0x10, 0xb3)
|
||||
|
|
@ -2835,7 +2769,6 @@ static inline HRESULT IDWriteInlineObject_GetBreakConditions(IDWriteInlineObject
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteInlineObject_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2847,8 +2780,7 @@ static inline HRESULT IDWriteInlineObject_GetBreakConditions(IDWriteInlineObject
|
|||
DEFINE_GUID(IID_IDWriteTextFormat, 0x9c906818, 0x31d7, 0x4fd3, 0xa1, 0x51, 0x7c, 0x5e, 0x22, 0x5d, 0xb5, 0x5a);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a")
|
||||
IDWriteTextFormat : public IUnknown
|
||||
{
|
||||
IDWriteTextFormat : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE SetTextAlignment(
|
||||
DWRITE_TEXT_ALIGNMENT alignment) = 0;
|
||||
|
||||
|
|
@ -2876,23 +2808,17 @@ IDWriteTextFormat : public IUnknown
|
|||
FLOAT line_spacing,
|
||||
FLOAT baseline) = 0;
|
||||
|
||||
virtual DWRITE_TEXT_ALIGNMENT STDMETHODCALLTYPE GetTextAlignment(
|
||||
) = 0;
|
||||
virtual DWRITE_TEXT_ALIGNMENT STDMETHODCALLTYPE GetTextAlignment() = 0;
|
||||
|
||||
virtual DWRITE_PARAGRAPH_ALIGNMENT STDMETHODCALLTYPE GetParagraphAlignment(
|
||||
) = 0;
|
||||
virtual DWRITE_PARAGRAPH_ALIGNMENT STDMETHODCALLTYPE GetParagraphAlignment() = 0;
|
||||
|
||||
virtual DWRITE_WORD_WRAPPING STDMETHODCALLTYPE GetWordWrapping(
|
||||
) = 0;
|
||||
virtual DWRITE_WORD_WRAPPING STDMETHODCALLTYPE GetWordWrapping() = 0;
|
||||
|
||||
virtual DWRITE_READING_DIRECTION STDMETHODCALLTYPE GetReadingDirection(
|
||||
) = 0;
|
||||
virtual DWRITE_READING_DIRECTION STDMETHODCALLTYPE GetReadingDirection() = 0;
|
||||
|
||||
virtual DWRITE_FLOW_DIRECTION STDMETHODCALLTYPE GetFlowDirection(
|
||||
) = 0;
|
||||
virtual DWRITE_FLOW_DIRECTION STDMETHODCALLTYPE GetFlowDirection() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetIncrementalTabStop(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetIncrementalTabStop() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetTrimming(
|
||||
DWRITE_TRIMMING * options,
|
||||
|
|
@ -2906,32 +2832,25 @@ IDWriteTextFormat : public IUnknown
|
|||
virtual HRESULT STDMETHODCALLTYPE GetFontCollection(
|
||||
IDWriteFontCollection * *collection) = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFamilyNameLength(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFamilyNameLength() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFamilyName(
|
||||
WCHAR * name,
|
||||
UINT32 size) = 0;
|
||||
|
||||
virtual DWRITE_FONT_WEIGHT STDMETHODCALLTYPE GetFontWeight(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_WEIGHT STDMETHODCALLTYPE GetFontWeight() = 0;
|
||||
|
||||
virtual DWRITE_FONT_STYLE STDMETHODCALLTYPE GetFontStyle(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_STYLE STDMETHODCALLTYPE GetFontStyle() = 0;
|
||||
|
||||
virtual DWRITE_FONT_STRETCH STDMETHODCALLTYPE GetFontStretch(
|
||||
) = 0;
|
||||
virtual DWRITE_FONT_STRETCH STDMETHODCALLTYPE GetFontStretch() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetFontSize(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetFontSize() = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetLocaleNameLength(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetLocaleNameLength() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetLocaleName(
|
||||
WCHAR * name,
|
||||
UINT32 size) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextFormat, 0x9c906818, 0x31d7, 0x4fd3, 0xa1, 0x51, 0x7c, 0x5e, 0x22, 0x5d, 0xb5, 0x5a)
|
||||
|
|
@ -3180,7 +3099,6 @@ static inline HRESULT IDWriteTextFormat_GetLocaleName(IDWriteTextFormat* This,WC
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextFormat_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -3192,18 +3110,15 @@ static inline HRESULT IDWriteTextFormat_GetLocaleName(IDWriteTextFormat* This,WC
|
|||
DEFINE_GUID(IID_IDWriteTypography, 0x55f1112b, 0x1dc2, 0x4b3c, 0x95, 0x41, 0xf4, 0x68, 0x94, 0xed, 0x85, 0xb6);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6")
|
||||
IDWriteTypography : public IUnknown
|
||||
{
|
||||
IDWriteTypography : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE AddFontFeature(
|
||||
DWRITE_FONT_FEATURE feature) = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFeatureCount(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetFontFeatureCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFeature(
|
||||
UINT32 index,
|
||||
DWRITE_FONT_FEATURE * feature) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTypography, 0x55f1112b, 0x1dc2, 0x4b3c, 0x95, 0x41, 0xf4, 0x68, 0x94, 0xed, 0x85, 0xb6)
|
||||
|
|
@ -3280,7 +3195,6 @@ static inline HRESULT IDWriteTypography_GetFontFeature(IDWriteTypography* This,U
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTypography_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -3292,8 +3206,7 @@ static inline HRESULT IDWriteTypography_GetFontFeature(IDWriteTypography* This,U
|
|||
DEFINE_GUID(IID_IDWriteBitmapRenderTarget, 0x5e5a32a3, 0x8dff, 0x4773, 0x9f, 0xf6, 0x06, 0x96, 0xea, 0xb7, 0x72, 0x67);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267")
|
||||
IDWriteBitmapRenderTarget : public IUnknown
|
||||
{
|
||||
IDWriteBitmapRenderTarget : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE DrawGlyphRun(
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
|
|
@ -3303,11 +3216,9 @@ IDWriteBitmapRenderTarget : public IUnknown
|
|||
COLORREF textColor,
|
||||
RECT* blackbox_rect = 0) = 0;
|
||||
|
||||
virtual HDC STDMETHODCALLTYPE GetMemoryDC(
|
||||
) = 0;
|
||||
virtual HDC STDMETHODCALLTYPE GetMemoryDC() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetPixelsPerDip(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetPixelsPerDip() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetPixelsPerDip(
|
||||
FLOAT pixels_per_dip) = 0;
|
||||
|
|
@ -3324,7 +3235,6 @@ IDWriteBitmapRenderTarget : public IUnknown
|
|||
virtual HRESULT STDMETHODCALLTYPE Resize(
|
||||
UINT32 width,
|
||||
UINT32 height) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteBitmapRenderTarget, 0x5e5a32a3, 0x8dff, 0x4773, 0x9f, 0xf6, 0x06, 0x96, 0xea, 0xb7, 0x72, 0x67)
|
||||
|
|
@ -3446,7 +3356,6 @@ static inline HRESULT IDWriteBitmapRenderTarget_Resize(IDWriteBitmapRenderTarget
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteBitmapRenderTarget_INTERFACE_DEFINED__ */
|
||||
|
||||
#ifndef _WINGDI_
|
||||
|
|
@ -3478,8 +3387,7 @@ typedef struct tagLOGFONTW *LPLOGFONTW;
|
|||
DEFINE_GUID(IID_IDWriteGdiInterop, 0x1edd9491, 0x9853, 0x4299, 0x89, 0x8f, 0x64, 0x32, 0x98, 0x3b, 0x6f, 0x3a);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a")
|
||||
IDWriteGdiInterop : public IUnknown
|
||||
{
|
||||
IDWriteGdiInterop : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateFontFromLOGFONT(
|
||||
const LOGFONTW* logfont,
|
||||
IDWriteFont** font) = 0;
|
||||
|
|
@ -3502,7 +3410,6 @@ IDWriteGdiInterop : public IUnknown
|
|||
UINT32 width,
|
||||
UINT32 height,
|
||||
IDWriteBitmapRenderTarget * *target) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteGdiInterop, 0x1edd9491, 0x9853, 0x4299, 0x89, 0x8f, 0x64, 0x32, 0x98, 0x3b, 0x6f, 0x3a)
|
||||
|
|
@ -3603,7 +3510,6 @@ static inline HRESULT IDWriteGdiInterop_CreateBitmapRenderTarget(IDWriteGdiInter
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteGdiInterop_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -3615,8 +3521,7 @@ static inline HRESULT IDWriteGdiInterop_CreateBitmapRenderTarget(IDWriteGdiInter
|
|||
DEFINE_GUID(IID_IDWriteTextLayout, 0x53737037, 0x6d14, 0x410b, 0x9b, 0xfe, 0x0b, 0x18, 0x2b, 0xb7, 0x09, 0x61);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961")
|
||||
IDWriteTextLayout : public IDWriteTextFormat
|
||||
{
|
||||
IDWriteTextLayout : public IDWriteTextFormat {
|
||||
virtual HRESULT STDMETHODCALLTYPE SetMaxWidth(
|
||||
FLOAT maxWidth) = 0;
|
||||
|
||||
|
|
@ -3671,11 +3576,9 @@ IDWriteTextLayout : public IDWriteTextFormat
|
|||
const WCHAR* locale,
|
||||
DWRITE_TEXT_RANGE range) = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetMaxWidth(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetMaxWidth() = 0;
|
||||
|
||||
virtual FLOAT STDMETHODCALLTYPE GetMaxHeight(
|
||||
) = 0;
|
||||
virtual FLOAT STDMETHODCALLTYPE GetMaxHeight() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontCollection(
|
||||
UINT32 pos,
|
||||
|
|
@ -3796,7 +3699,6 @@ IDWriteTextLayout : public IDWriteTextFormat
|
|||
DWRITE_HIT_TEST_METRICS * metrics,
|
||||
UINT32 max_metricscount,
|
||||
UINT32 * actual_metricscount) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextLayout, 0x53737037, 0x6d14, 0x410b, 0x9b, 0xfe, 0x0b, 0x18, 0x2b, 0xb7, 0x09, 0x61)
|
||||
|
|
@ -4385,7 +4287,6 @@ static inline HRESULT IDWriteTextLayout_HitTestTextRange(IDWriteTextLayout* This
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextLayout_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -4397,9 +4298,7 @@ static inline HRESULT IDWriteTextLayout_HitTestTextRange(IDWriteTextLayout* This
|
|||
DEFINE_GUID(IID_IDWriteNumberSubstitution, 0x14885cc9, 0xbab0, 0x4f90, 0xb6, 0xed, 0x5c, 0x36, 0x6a, 0x2c, 0xd0, 0x3d);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("14885cc9-bab0-4f90-b6ed-5c366a2cd03d")
|
||||
IDWriteNumberSubstitution : public IUnknown
|
||||
{
|
||||
};
|
||||
IDWriteNumberSubstitution : public IUnknown{};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteNumberSubstitution, 0x14885cc9, 0xbab0, 0x4f90, 0xb6, 0xed, 0x5c, 0x36, 0x6a, 0x2c, 0xd0, 0x3d)
|
||||
#endif
|
||||
|
|
@ -4448,7 +4347,6 @@ static inline ULONG IDWriteNumberSubstitution_Release(IDWriteNumberSubstitution*
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteNumberSubstitution_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -4460,8 +4358,7 @@ static inline ULONG IDWriteNumberSubstitution_Release(IDWriteNumberSubstitution*
|
|||
DEFINE_GUID(IID_IDWriteTextAnalysisSource, 0x688e1a58, 0x5094, 0x47c8, 0xad, 0xc8, 0xfb, 0xce, 0xa6, 0x0a, 0xe9, 0x2b);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("688e1a58-5094-47c8-adc8-fbcea60ae92b")
|
||||
IDWriteTextAnalysisSource : public IUnknown
|
||||
{
|
||||
IDWriteTextAnalysisSource : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetTextAtPosition(
|
||||
UINT32 position,
|
||||
const WCHAR** text,
|
||||
|
|
@ -4472,8 +4369,7 @@ IDWriteTextAnalysisSource : public IUnknown
|
|||
const WCHAR** text,
|
||||
UINT32* text_len) = 0;
|
||||
|
||||
virtual DWRITE_READING_DIRECTION STDMETHODCALLTYPE GetParagraphReadingDirection(
|
||||
) = 0;
|
||||
virtual DWRITE_READING_DIRECTION STDMETHODCALLTYPE GetParagraphReadingDirection() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetLocaleName(
|
||||
UINT32 position,
|
||||
|
|
@ -4484,7 +4380,6 @@ IDWriteTextAnalysisSource : public IUnknown
|
|||
UINT32 position,
|
||||
UINT32 * text_len,
|
||||
IDWriteNumberSubstitution * *substitution) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextAnalysisSource, 0x688e1a58, 0x5094, 0x47c8, 0xad, 0xc8, 0xfb, 0xce, 0xa6, 0x0a, 0xe9, 0x2b)
|
||||
|
|
@ -4584,7 +4479,6 @@ static inline HRESULT IDWriteTextAnalysisSource_GetNumberSubstitution(IDWriteTex
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextAnalysisSource_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -4596,8 +4490,7 @@ static inline HRESULT IDWriteTextAnalysisSource_GetNumberSubstitution(IDWriteTex
|
|||
DEFINE_GUID(IID_IDWriteTextAnalysisSink, 0x5810cd44, 0x0ca0, 0x4701, 0xb3, 0xfa, 0xbe, 0xc5, 0x18, 0x2a, 0xe4, 0xf6);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("5810cd44-0ca0-4701-b3fa-bec5182ae4f6")
|
||||
IDWriteTextAnalysisSink : public IUnknown
|
||||
{
|
||||
IDWriteTextAnalysisSink : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE SetScriptAnalysis(
|
||||
UINT32 position,
|
||||
UINT32 length,
|
||||
|
|
@ -4618,7 +4511,6 @@ IDWriteTextAnalysisSink : public IUnknown
|
|||
UINT32 position,
|
||||
UINT32 length,
|
||||
IDWriteNumberSubstitution * substitution) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextAnalysisSink, 0x5810cd44, 0x0ca0, 0x4701, 0xb3, 0xfa, 0xbe, 0xc5, 0x18, 0x2a, 0xe4, 0xf6)
|
||||
|
|
@ -4712,7 +4604,6 @@ static inline HRESULT IDWriteTextAnalysisSink_SetNumberSubstitution(IDWriteTextA
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextAnalysisSink_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -4724,8 +4615,7 @@ static inline HRESULT IDWriteTextAnalysisSink_SetNumberSubstitution(IDWriteTextA
|
|||
DEFINE_GUID(IID_IDWriteTextAnalyzer, 0xb7e6163e, 0x7f46, 0x43b4, 0x84, 0xb3, 0xe4, 0xe6, 0x24, 0x9c, 0x36, 0x5d);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d")
|
||||
IDWriteTextAnalyzer : public IUnknown
|
||||
{
|
||||
IDWriteTextAnalyzer : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE AnalyzeScript(
|
||||
IDWriteTextAnalysisSource * source,
|
||||
UINT32 position,
|
||||
|
|
@ -4811,7 +4701,6 @@ IDWriteTextAnalyzer : public IUnknown
|
|||
UINT32 feature_ranges,
|
||||
FLOAT* glyph_advances,
|
||||
DWRITE_GLYPH_OFFSET* glyph_offsets) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextAnalyzer, 0xb7e6163e, 0x7f46, 0x43b4, 0x84, 0xb3, 0xe4, 0xe6, 0x24, 0x9c, 0x36, 0x5d)
|
||||
|
|
@ -4985,7 +4874,6 @@ static inline HRESULT IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(IDWrit
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextAnalyzer_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -4997,8 +4885,7 @@ static inline HRESULT IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(IDWrit
|
|||
DEFINE_GUID(IID_IDWriteGlyphRunAnalysis, 0x7d97dbf7, 0xe085, 0x42d4, 0x81, 0xe3, 0x6a, 0x88, 0x3b, 0xde, 0xd1, 0x18);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118")
|
||||
IDWriteGlyphRunAnalysis : public IUnknown
|
||||
{
|
||||
IDWriteGlyphRunAnalysis : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetAlphaTextureBounds(
|
||||
DWRITE_TEXTURE_TYPE type,
|
||||
RECT * bounds) = 0;
|
||||
|
|
@ -5014,7 +4901,6 @@ IDWriteGlyphRunAnalysis : public IUnknown
|
|||
FLOAT * blendGamma,
|
||||
FLOAT * blendEnhancedContrast,
|
||||
FLOAT * blendClearTypeLevel) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteGlyphRunAnalysis, 0x7d97dbf7, 0xe085, 0x42d4, 0x81, 0xe3, 0x6a, 0x88, 0x3b, 0xde, 0xd1, 0x18)
|
||||
|
|
@ -5098,7 +4984,6 @@ static inline HRESULT IDWriteGlyphRunAnalysis_GetAlphaBlendParams(IDWriteGlyphRu
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteGlyphRunAnalysis_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -5110,8 +4995,7 @@ static inline HRESULT IDWriteGlyphRunAnalysis_GetAlphaBlendParams(IDWriteGlyphRu
|
|||
DEFINE_GUID(IID_IDWriteFactory, 0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48")
|
||||
IDWriteFactory : public IUnknown
|
||||
{
|
||||
IDWriteFactory : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetSystemFontCollection(
|
||||
IDWriteFontCollection * *collection,
|
||||
WINBOOL check_for_updates = FALSE) = 0;
|
||||
|
|
@ -5225,7 +5109,6 @@ IDWriteFactory : public IUnknown
|
|||
FLOAT baseline_x,
|
||||
FLOAT baseline_y,
|
||||
IDWriteGlyphRunAnalysis** analysis) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFactory, 0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48)
|
||||
|
|
@ -5497,7 +5380,6 @@ static inline HRESULT IDWriteFactory_CreateGlyphRunAnalysis(IDWriteFactory* This
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFactory_INTERFACE_DEFINED__ */
|
||||
|
||||
HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE, REFIID, IUnknown**);
|
||||
|
|
@ -5507,7 +5389,6 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE,REFIID,IUnknown**);
|
|||
#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
|
||||
/* Begin additional prototypes for all interfaces */
|
||||
|
||||
|
||||
/* End additional prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -176,8 +176,7 @@ typedef struct DWRITE_COLOR_GLYPH_RUN {
|
|||
DEFINE_GUID(IID_IDWriteTextRenderer1, 0xd3e0e934, 0x22a0, 0x427e, 0xaa, 0xe4, 0x7d, 0x95, 0x74, 0xb5, 0x9d, 0xb1);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("d3e0e934-22a0-427e-aae4-7d9574b59db1")
|
||||
IDWriteTextRenderer1 : public IDWriteTextRenderer
|
||||
{
|
||||
IDWriteTextRenderer1 : public IDWriteTextRenderer {
|
||||
virtual HRESULT STDMETHODCALLTYPE DrawGlyphRun(
|
||||
void* context,
|
||||
FLOAT originX,
|
||||
|
|
@ -213,7 +212,6 @@ IDWriteTextRenderer1 : public IDWriteTextRenderer
|
|||
WINBOOL is_sideways,
|
||||
WINBOOL is_rtl,
|
||||
IUnknown* effect) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextRenderer1, 0xd3e0e934, 0x22a0, 0x427e, 0xaa, 0xe4, 0x7d, 0x95, 0x74, 0xb5, 0x9d, 0xb1)
|
||||
|
|
@ -391,7 +389,6 @@ static inline HRESULT IDWriteTextRenderer1_DrawInlineObject(IDWriteTextRenderer1
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextRenderer1_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -403,8 +400,7 @@ static inline HRESULT IDWriteTextRenderer1_DrawInlineObject(IDWriteTextRenderer1
|
|||
DEFINE_GUID(IID_IDWriteFontFallback, 0xefa008f9, 0xf7a1, 0x48bf, 0xb0, 0x5c, 0xf2, 0x24, 0x71, 0x3c, 0xc0, 0xff);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("efa008f9-f7a1-48bf-b05c-f224713cc0ff")
|
||||
IDWriteFontFallback : public IUnknown
|
||||
{
|
||||
IDWriteFontFallback : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE MapCharacters(
|
||||
IDWriteTextAnalysisSource * source,
|
||||
UINT32 position,
|
||||
|
|
@ -417,7 +413,6 @@ IDWriteFontFallback : public IUnknown
|
|||
UINT32* mappedLength,
|
||||
IDWriteFont** mappedFont,
|
||||
FLOAT* scale) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFallback, 0xefa008f9, 0xf7a1, 0x48bf, 0xb0, 0x5c, 0xf2, 0x24, 0x71, 0x3c, 0xc0, 0xff)
|
||||
|
|
@ -488,7 +483,6 @@ static inline HRESULT IDWriteFontFallback_MapCharacters(IDWriteFontFallback* Thi
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFallback_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -500,32 +494,27 @@ static inline HRESULT IDWriteFontFallback_MapCharacters(IDWriteFontFallback* Thi
|
|||
DEFINE_GUID(IID_IDWriteTextFormat1, 0x5f174b49, 0x0d8b, 0x4cfb, 0x8b, 0xca, 0xf1, 0xcc, 0xe9, 0xd0, 0x6c, 0x67);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("5f174b49-0d8b-4cfb-8bca-f1cce9d06c67")
|
||||
IDWriteTextFormat1 : public IDWriteTextFormat
|
||||
{
|
||||
IDWriteTextFormat1 : public IDWriteTextFormat {
|
||||
virtual HRESULT STDMETHODCALLTYPE SetVerticalGlyphOrientation(
|
||||
DWRITE_VERTICAL_GLYPH_ORIENTATION orientation) = 0;
|
||||
|
||||
virtual DWRITE_VERTICAL_GLYPH_ORIENTATION STDMETHODCALLTYPE GetVerticalGlyphOrientation(
|
||||
) = 0;
|
||||
virtual DWRITE_VERTICAL_GLYPH_ORIENTATION STDMETHODCALLTYPE GetVerticalGlyphOrientation() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetLastLineWrapping(
|
||||
WINBOOL lastline_wrapping_enabled) = 0;
|
||||
|
||||
virtual WINBOOL STDMETHODCALLTYPE GetLastLineWrapping(
|
||||
) = 0;
|
||||
virtual WINBOOL STDMETHODCALLTYPE GetLastLineWrapping() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetOpticalAlignment(
|
||||
DWRITE_OPTICAL_ALIGNMENT alignment) = 0;
|
||||
|
||||
virtual DWRITE_OPTICAL_ALIGNMENT STDMETHODCALLTYPE GetOpticalAlignment(
|
||||
) = 0;
|
||||
virtual DWRITE_OPTICAL_ALIGNMENT STDMETHODCALLTYPE GetOpticalAlignment() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetFontFallback(
|
||||
IDWriteFontFallback * fallback) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFallback(
|
||||
IDWriteFontFallback * *fallback) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextFormat1, 0x5f174b49, 0x0d8b, 0x4cfb, 0x8b, 0xca, 0xf1, 0xcc, 0xe9, 0xd0, 0x6c, 0x67)
|
||||
|
|
@ -838,7 +827,6 @@ static inline HRESULT IDWriteTextFormat1_GetFontFallback(IDWriteTextFormat1* Thi
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextFormat1_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -850,35 +838,30 @@ static inline HRESULT IDWriteTextFormat1_GetFontFallback(IDWriteTextFormat1* Thi
|
|||
DEFINE_GUID(IID_IDWriteTextLayout2, 0x1093c18f, 0x8d5e, 0x43f0, 0xb0, 0x64, 0x09, 0x17, 0x31, 0x1b, 0x52, 0x5e);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("1093c18f-8d5e-43f0-b064-0917311b525e")
|
||||
IDWriteTextLayout2 : public IDWriteTextLayout1
|
||||
{
|
||||
IDWriteTextLayout2 : public IDWriteTextLayout1 {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetMetrics(
|
||||
DWRITE_TEXT_METRICS1 * metrics) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetVerticalGlyphOrientation(
|
||||
DWRITE_VERTICAL_GLYPH_ORIENTATION orientation) = 0;
|
||||
|
||||
virtual DWRITE_VERTICAL_GLYPH_ORIENTATION STDMETHODCALLTYPE GetVerticalGlyphOrientation(
|
||||
) = 0;
|
||||
virtual DWRITE_VERTICAL_GLYPH_ORIENTATION STDMETHODCALLTYPE GetVerticalGlyphOrientation() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetLastLineWrapping(
|
||||
WINBOOL lastline_wrapping_enabled) = 0;
|
||||
|
||||
virtual WINBOOL STDMETHODCALLTYPE GetLastLineWrapping(
|
||||
) = 0;
|
||||
virtual WINBOOL STDMETHODCALLTYPE GetLastLineWrapping() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetOpticalAlignment(
|
||||
DWRITE_OPTICAL_ALIGNMENT alignment) = 0;
|
||||
|
||||
virtual DWRITE_OPTICAL_ALIGNMENT STDMETHODCALLTYPE GetOpticalAlignment(
|
||||
) = 0;
|
||||
virtual DWRITE_OPTICAL_ALIGNMENT STDMETHODCALLTYPE GetOpticalAlignment() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetFontFallback(
|
||||
IDWriteFontFallback * fallback) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFontFallback(
|
||||
IDWriteFontFallback * *fallback) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextLayout2, 0x1093c18f, 0x8d5e, 0x43f0, 0xb0, 0x64, 0x09, 0x17, 0x31, 0x1b, 0x52, 0x5e)
|
||||
|
|
@ -1580,7 +1563,6 @@ static inline HRESULT IDWriteTextLayout2_GetFontFallback(IDWriteTextLayout2* Thi
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextLayout2_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1592,8 +1574,7 @@ static inline HRESULT IDWriteTextLayout2_GetFontFallback(IDWriteTextLayout2* Thi
|
|||
DEFINE_GUID(IID_IDWriteTextAnalyzer2, 0x553a9ff3, 0x5693, 0x4df7, 0xb5, 0x2b, 0x74, 0x80, 0x6f, 0x7f, 0x2e, 0xb9);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("553a9ff3-5693-4df7-b52b-74806f7f2eb9")
|
||||
IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1
|
||||
{
|
||||
IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1 {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetGlyphOrientationTransform(
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE angle,
|
||||
WINBOOL is_sideways,
|
||||
|
|
@ -1617,7 +1598,6 @@ IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1
|
|||
UINT32 glyph_count,
|
||||
const UINT16* indices,
|
||||
UINT8* feature_applies) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteTextAnalyzer2, 0x553a9ff3, 0x5693, 0x4df7, 0xb5, 0x2b, 0x74, 0x80, 0x6f, 0x7f, 0x2e, 0xb9)
|
||||
|
|
@ -1962,7 +1942,6 @@ static inline HRESULT IDWriteTextAnalyzer2_CheckTypographicFeature(IDWriteTextAn
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteTextAnalyzer2_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -1974,8 +1953,7 @@ static inline HRESULT IDWriteTextAnalyzer2_CheckTypographicFeature(IDWriteTextAn
|
|||
DEFINE_GUID(IID_IDWriteFontFallbackBuilder, 0xfd882d06, 0x8aba, 0x4fb8, 0xb8, 0x49, 0x8b, 0xe8, 0xb7, 0x3e, 0x14, 0xde);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("fd882d06-8aba-4fb8-b849-8be8b73e14de")
|
||||
IDWriteFontFallbackBuilder : public IUnknown
|
||||
{
|
||||
IDWriteFontFallbackBuilder : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE AddMapping(
|
||||
const DWRITE_UNICODE_RANGE* ranges,
|
||||
UINT32 rangesCount,
|
||||
|
|
@ -1991,7 +1969,6 @@ IDWriteFontFallbackBuilder : public IUnknown
|
|||
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateFontFallback(
|
||||
IDWriteFontFallback * *fallback) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFallbackBuilder, 0xfd882d06, 0x8aba, 0x4fb8, 0xb8, 0x49, 0x8b, 0xe8, 0xb7, 0x3e, 0x14, 0xde)
|
||||
|
|
@ -2075,7 +2052,6 @@ static inline HRESULT IDWriteFontFallbackBuilder_CreateFontFallback(IDWriteFontF
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFallbackBuilder_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2087,11 +2063,8 @@ static inline HRESULT IDWriteFontFallbackBuilder_CreateFontFallback(IDWriteFontF
|
|||
DEFINE_GUID(IID_IDWriteFont2, 0x29748ed6, 0x8c9c, 0x4a6a, 0xbe, 0x0b, 0xd9, 0x12, 0xe8, 0x53, 0x89, 0x44);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944")
|
||||
IDWriteFont2 : public IDWriteFont1
|
||||
{
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsColorFont(
|
||||
) = 0;
|
||||
|
||||
IDWriteFont2 : public IDWriteFont1 {
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsColorFont() = 0;
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFont2, 0x29748ed6, 0x8c9c, 0x4a6a, 0xbe, 0x0b, 0xd9, 0x12, 0xe8, 0x53, 0x89, 0x44)
|
||||
|
|
@ -2272,7 +2245,6 @@ static inline WINBOOL IDWriteFont2_IsColorFont(IDWriteFont2* This) {
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFont2_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2284,16 +2256,12 @@ static inline WINBOOL IDWriteFont2_IsColorFont(IDWriteFont2* This) {
|
|||
DEFINE_GUID(IID_IDWriteFontFace2, 0xd8b768ff, 0x64bc, 0x4e66, 0x98, 0x2b, 0xec, 0x8e, 0x87, 0xf6, 0x93, 0xf7);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7")
|
||||
IDWriteFontFace2 : public IDWriteFontFace1
|
||||
{
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsColorFont(
|
||||
) = 0;
|
||||
IDWriteFontFace2 : public IDWriteFontFace1 {
|
||||
virtual WINBOOL STDMETHODCALLTYPE IsColorFont() = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetColorPaletteCount(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetColorPaletteCount() = 0;
|
||||
|
||||
virtual UINT32 STDMETHODCALLTYPE GetPaletteEntryCount(
|
||||
) = 0;
|
||||
virtual UINT32 STDMETHODCALLTYPE GetPaletteEntryCount() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetPaletteEntries(
|
||||
UINT32 palette_index,
|
||||
|
|
@ -2312,7 +2280,6 @@ IDWriteFontFace2 : public IDWriteFontFace1
|
|||
IDWriteRenderingParams* params,
|
||||
DWRITE_RENDERING_MODE* renderingmode,
|
||||
DWRITE_GRID_FIT_MODE* gridfitmode) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFontFace2, 0xd8b768ff, 0x64bc, 0x4e66, 0x98, 0x2b, 0xec, 0x8e, 0x87, 0xf6, 0x93, 0xf7)
|
||||
|
|
@ -2669,7 +2636,6 @@ static inline HRESULT IDWriteFontFace2_GetRecommendedRenderingMode(IDWriteFontFa
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFontFace2_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2681,14 +2647,12 @@ static inline HRESULT IDWriteFontFace2_GetRecommendedRenderingMode(IDWriteFontFa
|
|||
DEFINE_GUID(IID_IDWriteColorGlyphRunEnumerator, 0xd31fbe17, 0xf157, 0x41a2, 0x8d, 0x24, 0xcb, 0x77, 0x9e, 0x05, 0x60, 0xe8);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("d31fbe17-f157-41a2-8d24-cb779e0560e8")
|
||||
IDWriteColorGlyphRunEnumerator : public IUnknown
|
||||
{
|
||||
IDWriteColorGlyphRunEnumerator : public IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE MoveNext(
|
||||
WINBOOL * hasRun) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetCurrentRun(
|
||||
const DWRITE_COLOR_GLYPH_RUN** run) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteColorGlyphRunEnumerator, 0xd31fbe17, 0xf157, 0x41a2, 0x8d, 0x24, 0xcb, 0x77, 0x9e, 0x05, 0x60, 0xe8)
|
||||
|
|
@ -2757,7 +2721,6 @@ static inline HRESULT IDWriteColorGlyphRunEnumerator_GetCurrentRun(IDWriteColorG
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteColorGlyphRunEnumerator_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2769,11 +2732,8 @@ static inline HRESULT IDWriteColorGlyphRunEnumerator_GetCurrentRun(IDWriteColorG
|
|||
DEFINE_GUID(IID_IDWriteRenderingParams2, 0xf9d711c3, 0x9777, 0x40ae, 0x87, 0xe8, 0x3e, 0x5a, 0xf9, 0xbf, 0x09, 0x48);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("f9d711c3-9777-40ae-87e8-3e5af9bf0948")
|
||||
IDWriteRenderingParams2 : public IDWriteRenderingParams1
|
||||
{
|
||||
virtual DWRITE_GRID_FIT_MODE STDMETHODCALLTYPE GetGridFitMode(
|
||||
) = 0;
|
||||
|
||||
IDWriteRenderingParams2 : public IDWriteRenderingParams1 {
|
||||
virtual DWRITE_GRID_FIT_MODE STDMETHODCALLTYPE GetGridFitMode() = 0;
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteRenderingParams2, 0xf9d711c3, 0x9777, 0x40ae, 0x87, 0xe8, 0x3e, 0x5a, 0xf9, 0xbf, 0x09, 0x48)
|
||||
|
|
@ -2881,7 +2841,6 @@ static inline DWRITE_GRID_FIT_MODE IDWriteRenderingParams2_GetGridFitMode(IDWrit
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteRenderingParams2_INTERFACE_DEFINED__ */
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -2893,8 +2852,7 @@ static inline DWRITE_GRID_FIT_MODE IDWriteRenderingParams2_GetGridFitMode(IDWrit
|
|||
DEFINE_GUID(IID_IDWriteFactory2, 0x0439fc60, 0xca44, 0x4994, 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec);
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
MIDL_INTERFACE("0439fc60-ca44-4994-8dee-3a9af7b732ec")
|
||||
IDWriteFactory2 : public IDWriteFactory1
|
||||
{
|
||||
IDWriteFactory2 : public IDWriteFactory1 {
|
||||
virtual HRESULT STDMETHODCALLTYPE GetSystemFontFallback(
|
||||
IDWriteFontFallback * *fallback) = 0;
|
||||
|
||||
|
|
@ -2931,7 +2889,6 @@ IDWriteFactory2 : public IDWriteFactory1
|
|||
FLOAT originX,
|
||||
FLOAT originY,
|
||||
IDWriteGlyphRunAnalysis** analysis) = 0;
|
||||
|
||||
};
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IDWriteFactory2, 0x0439fc60, 0xca44, 0x4994, 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec)
|
||||
|
|
@ -3282,12 +3239,10 @@ static inline HRESULT IDWriteFactory2_CreateGlyphRunAnalysis(IDWriteFactory2* Th
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __IDWriteFactory2_INTERFACE_DEFINED__ */
|
||||
|
||||
/* Begin additional prototypes for all interfaces */
|
||||
|
||||
|
||||
/* End additional prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -159,7 +159,7 @@ static void ft2_MwFontFree(void* handle) {
|
|||
free(ttf);
|
||||
}
|
||||
|
||||
int MWFL_FT2Setup(void) {
|
||||
int MwFL_FT2Setup(void) {
|
||||
/* Try and load FreeType2. If it fails, return 1, signifying we default to stbtt. */
|
||||
void* ftlib;
|
||||
#ifdef __APPLE__
|
||||
|
|
|
|||
148
src/text/gdi.c
Normal file
148
src/text/gdi.c
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
#ifdef USE_GDI_TEXT
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
struct _MwFLFont {
|
||||
HANDLE handle;
|
||||
HFONT font;
|
||||
HDC dc;
|
||||
};
|
||||
|
||||
static int GDI_MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, MwLLColor color) {
|
||||
BITMAPINFOHEADER bmih;
|
||||
int tw;
|
||||
int th;
|
||||
HBITMAP hbm;
|
||||
RGBQUAD* bits = NULL;
|
||||
HDC hmdc;
|
||||
char* t = MwUTF8ToACP(text);
|
||||
unsigned char* px;
|
||||
int y, x;
|
||||
MwRect r;
|
||||
MwLLPixmap p;
|
||||
|
||||
tw = MwTextWidth(handle, ttf, text);
|
||||
th = MwTextHeight(handle, ttf, text);
|
||||
|
||||
px = malloc(tw * th * 4);
|
||||
|
||||
bmih.biSize = sizeof(bmih);
|
||||
bmih.biWidth = tw;
|
||||
bmih.biHeight = -(LONG)th;
|
||||
bmih.biPlanes = 1;
|
||||
bmih.biBitCount = 32;
|
||||
bmih.biCompression = BI_RGB;
|
||||
bmih.biSizeImage = 0;
|
||||
bmih.biXPelsPerMeter = 0;
|
||||
bmih.biYPelsPerMeter = 0;
|
||||
bmih.biClrUsed = 0;
|
||||
bmih.biClrImportant = 0;
|
||||
|
||||
hbm = CreateDIBSection(ttf->dc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
|
||||
|
||||
hmdc = CreateCompatibleDC(ttf->dc);
|
||||
SelectObject(hmdc, hbm);
|
||||
SelectObject(hmdc, ttf->font);
|
||||
|
||||
TextOut(hmdc, 0, 0, t, strlen(t));
|
||||
|
||||
DeleteDC(hmdc);
|
||||
|
||||
for(y = 0; y < th; y++) {
|
||||
for(x = 0; x < tw; x++) {
|
||||
unsigned char* opx = &px[(y * tw + x) * 4];
|
||||
|
||||
opx[0] = color->common.red;
|
||||
opx[1] = color->common.green;
|
||||
opx[2] = color->common.blue;
|
||||
opx[3] = 255 - bits[y * tw + x].rgbRed;
|
||||
}
|
||||
}
|
||||
|
||||
p = MwLoadRaw(handle, px, tw, th);
|
||||
r.x = point->x;
|
||||
r.y = point->y - th / 2;
|
||||
r.width = tw;
|
||||
r.height = th;
|
||||
|
||||
MwLLDrawPixmap(handle->lowlevel, &r, p);
|
||||
MwLLDestroyPixmap(p);
|
||||
free(px);
|
||||
|
||||
DeleteObject(hbm);
|
||||
|
||||
free(t);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GDI_MwTextWidth(MwFLFont ttf, const char* text) {
|
||||
char* t = MwUTF8ToACP(text);
|
||||
SIZE sz;
|
||||
|
||||
GetTextExtentPoint32(ttf->dc, t, strlen(t), &sz);
|
||||
|
||||
free(t);
|
||||
|
||||
return sz.cx;
|
||||
}
|
||||
|
||||
static int GDI_MwTextHeight(MwFLFont ttf, int count) {
|
||||
TEXTMETRIC tm;
|
||||
|
||||
GetTextMetrics(ttf->dc, &tm);
|
||||
|
||||
return tm.tmHeight * count;
|
||||
}
|
||||
|
||||
static void* GDI_MwFontLoad(unsigned char* data, unsigned int size, int px) {
|
||||
MwFLFont ttf = malloc(sizeof(*ttf));
|
||||
DWORD c;
|
||||
MwTTFInfo info;
|
||||
|
||||
if((info = MwTTFGetInfo(data, size)) == NULL) {
|
||||
free(ttf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ttf->dc = GetDC(NULL);
|
||||
|
||||
if((ttf->handle = AddFontMemResourceEx(data, size, 0, &c)) == NULL) {
|
||||
ReleaseDC(NULL, ttf->dc);
|
||||
MwTTFFreeInfo(info);
|
||||
free(ttf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((ttf->font = CreateFont(-px, 0, 0, 0, info->weight, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, info->family)) == NULL) {
|
||||
RemoveFontMemResourceEx(ttf->handle);
|
||||
ReleaseDC(NULL, ttf->dc);
|
||||
MwTTFFreeInfo(info);
|
||||
free(ttf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MwTTFFreeInfo(info);
|
||||
|
||||
SelectObject(ttf->dc, ttf->font);
|
||||
|
||||
return ttf;
|
||||
}
|
||||
|
||||
static void GDI_MwFontFree(void* handle) {
|
||||
MwFLFont ttf = handle;
|
||||
|
||||
DeleteObject(ttf->font);
|
||||
RemoveFontMemResourceEx(ttf->handle);
|
||||
ReleaseDC(NULL, ttf->dc);
|
||||
free(ttf);
|
||||
}
|
||||
|
||||
int MwFL_GDISetup(void) {
|
||||
MwFLDrawText = GDI_MwDrawText;
|
||||
MwFLTextWidth = GDI_MwTextWidth;
|
||||
MwFLTextHeight = GDI_MwTextHeight;
|
||||
MwFLFontLoad = GDI_MwFontLoad;
|
||||
MwFLFontFree = GDI_MwFontFree;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -300,11 +300,14 @@ static void bitmap_MwDrawText(MwWidget handle, MwPoint* point, const char* text,
|
|||
typedef int (*call_t)(void);
|
||||
void MwFLSetup(void) {
|
||||
call_t calls[] = {
|
||||
#ifdef USE_GDI_TEXT
|
||||
MwFL_GDISetup,
|
||||
#endif
|
||||
#ifdef USE_DIRECTWRITE
|
||||
MWFL_DWSetup,
|
||||
MwFL_DWSetup,
|
||||
#endif
|
||||
#ifdef USE_FREETYPE2
|
||||
MWFL_FT2Setup,
|
||||
MwFL_FT2Setup,
|
||||
#endif
|
||||
#ifdef USE_STB_TRUETYPE
|
||||
MwFL_STBTTSetup,
|
||||
|
|
|
|||
142
src/ttf.c
Normal file
142
src/ttf.c
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
#include <Mw/Milsko.h>
|
||||
|
||||
#define REMAIN (size - (data - old))
|
||||
|
||||
MwTTFInfo MwTTFGetInfo(unsigned char* data, int size){
|
||||
unsigned short n = 0;
|
||||
int i;
|
||||
unsigned char* old = data;
|
||||
MwTTFInfo info = malloc(sizeof(*info));
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
||||
if(size < 12){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
n |= data[4 + 0];
|
||||
n = n << 8;
|
||||
n |= data[4 + 1];
|
||||
|
||||
data += 12;
|
||||
for(i = 0; REMAIN > 0 && i < n; i++){
|
||||
unsigned int offset = 0;
|
||||
unsigned int length = 0;
|
||||
int j;
|
||||
|
||||
if(REMAIN < (4 + 4 + 4 + 4)){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(j = 0; j < 4; j++){
|
||||
offset = offset << 8;
|
||||
offset |= data[4 + 4 + j];
|
||||
|
||||
length = length << 8;
|
||||
length |= data[4 + 4 + 4 + j];
|
||||
}
|
||||
|
||||
if(memcmp(data, "OS/2", 4) == 0){
|
||||
if(length >= 68){
|
||||
unsigned char* rev = data;
|
||||
unsigned short us_weight = 0;
|
||||
|
||||
data = old + offset;
|
||||
if(REMAIN < 68){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(j = 0; j < 2; j++){
|
||||
us_weight = us_weight << 8;
|
||||
us_weight |= data[0x4 + j];
|
||||
}
|
||||
|
||||
info->weight = us_weight;
|
||||
|
||||
data = rev;
|
||||
}
|
||||
}else if(memcmp(data, "name", 4) == 0){
|
||||
if(length >= 6){
|
||||
unsigned short count = 0;
|
||||
unsigned char* rev = data;
|
||||
unsigned short str_off = 0;
|
||||
unsigned char* beg;
|
||||
|
||||
data = old + offset;
|
||||
if(REMAIN < (2 + 2 + 2)){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
beg = data;
|
||||
|
||||
for(j = 0; j < 2; j++){
|
||||
count = count << 8;
|
||||
count |= data[2 + j];
|
||||
|
||||
str_off = str_off << 8;
|
||||
str_off |= data[2 + 2 + j];
|
||||
}
|
||||
|
||||
data += 2 + 2 + 2;
|
||||
for(j = 0; j < count; j++){
|
||||
unsigned short platform = 0;
|
||||
unsigned short name = 0;
|
||||
unsigned short nam_len = 0;
|
||||
unsigned short nam_off = 0;
|
||||
int k;
|
||||
|
||||
if(REMAIN < (2 + 2 + 2 + 2 + 2 + 2)){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(k = 0; k < 2; k++){
|
||||
platform = platform << 8;
|
||||
platform |= data[0 + k];
|
||||
|
||||
name = name << 8;
|
||||
name |= data[2 + 2 + 2 + k];
|
||||
|
||||
nam_len = nam_len << 8;
|
||||
nam_len |= data[2 + 2 + 2 + 2 + k];
|
||||
|
||||
nam_off = nam_off << 8;
|
||||
nam_off |= data[2 + 2 + 2 + 2 + 2 + k];
|
||||
}
|
||||
|
||||
/* FIXME: this does not work with surrogate */
|
||||
if((platform == 0 || platform == 3) && name == 1){
|
||||
data = beg + str_off + nam_off;
|
||||
if(REMAIN < nam_len){
|
||||
MwTTFFreeInfo(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(info->family != NULL) free(info->family);
|
||||
|
||||
info->family = malloc(nam_len / 2 + 1);
|
||||
|
||||
for(k = 0; k < nam_len / 2; k++) info->family[k] = data[k * 2 + 1];
|
||||
info->family[k] = 0;
|
||||
}
|
||||
|
||||
data += 2 + 2 + 2 + 2 + 2 + 2;
|
||||
}
|
||||
|
||||
data = rev;
|
||||
}
|
||||
}
|
||||
|
||||
data += 4 + 4 + 4 + 4;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void MwTTFFreeInfo(MwTTFInfo info){
|
||||
if(info->family != NULL) free(info->family);
|
||||
free(info);
|
||||
}
|
||||
|
|
@ -336,7 +336,7 @@ static void draw_normal(MwWidget handle) {
|
|||
|
||||
r.width -= MwGetInteger(handle, MwNleftPadding);
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
if(align == MwALIGNMENT_CENTER) {
|
||||
p.x = r.width / 2;
|
||||
} else if(align == MwALIGNMENT_BEGINNING) {
|
||||
|
|
@ -353,11 +353,11 @@ static void draw_normal(MwWidget handle) {
|
|||
|
||||
p.x += 1;
|
||||
p.y += 1;
|
||||
MwDrawText(handle, NULL, &p, str, MwALIGNMENT_BEGINNING, shadow);
|
||||
MwDrawText(handle, NULL, &p, str, MwALIGNMENT_CENTER, shadow);
|
||||
|
||||
p.x -= 1;
|
||||
p.y -= 1;
|
||||
MwDrawText(handle, NULL, &p, str, MwALIGNMENT_BEGINNING, text);
|
||||
MwDrawText(handle, NULL, &p, str, MwALIGNMENT_CENTER, text);
|
||||
|
||||
MwLLFreeColor(shadow);
|
||||
MwLLFreeColor(text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue