directwrite font hinting
This commit is contained in:
parent
3377e3f94c
commit
4982d60647
@ -60,14 +60,24 @@ V_WidgetTheme V_GetWidgetTheme(void)
|
||||
{
|
||||
V_WidgetTheme theme = Zi;
|
||||
|
||||
theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/fixedsys.ttf")));
|
||||
theme.font_size = 16;
|
||||
// theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/fixedsys.ttf")));
|
||||
// theme.font_size = 16;
|
||||
|
||||
// theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/fixedsys.ttf")));
|
||||
// theme.font_size = 64;
|
||||
|
||||
// theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/OpenSans-Regular.ttf")));
|
||||
// theme.font_size = 18;
|
||||
|
||||
// theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/roboto-med.ttf")));
|
||||
// theme.font_size = 100;
|
||||
// theme.font_size = 18;
|
||||
|
||||
// theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/SegoeUI.ttf")));
|
||||
// theme.font_size = 18;
|
||||
|
||||
|
||||
theme.font = GC_FontKeyFromResource(ResourceKeyFromStore(&V_Resources, Lit("font/roboto-med.ttf")));
|
||||
theme.font_size = 100;
|
||||
|
||||
theme.window_background_color = Rgb32(0xff1a1d1e);
|
||||
theme.window_border_color = Rgb32(0xff343a3b);
|
||||
@ -792,10 +802,11 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
//- Build editor UI
|
||||
|
||||
/* TODO: Remove this (testing) */
|
||||
if (!V.root_space);
|
||||
//- Init test layout
|
||||
if (!V.root_space)
|
||||
{
|
||||
V_Space *space = PushStruct(perm, V_Space);
|
||||
space->axis = Axis_Y;
|
||||
space->axis = Axis_X;
|
||||
V.root_space = space;
|
||||
|
||||
{
|
||||
@ -818,6 +829,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
DllQueuePushNP(panel->first_window, panel->last_window, window, next_in_panel, prev_in_panel);
|
||||
++panel->windows_count;
|
||||
}
|
||||
panel->active_window_idx = 1;
|
||||
}
|
||||
|
||||
{
|
||||
@ -829,7 +841,22 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
{
|
||||
V_Window *window = PushStruct(perm, V_Window);
|
||||
window->panel = panel;
|
||||
window->is_tile_window = 1;
|
||||
window->is_viewport_window = 1;
|
||||
DllQueuePushNP(panel->first_window, panel->last_window, window, next_in_panel, prev_in_panel);
|
||||
++panel->windows_count;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
V_Panel *panel = PushStruct(perm, V_Panel);
|
||||
panel->space = space;
|
||||
DllQueuePushNP(space->first_panel, space->last_panel, panel, next_in_space, prev_in_space);
|
||||
++space->panels_count;
|
||||
|
||||
{
|
||||
V_Window *window = PushStruct(perm, V_Window);
|
||||
window->panel = panel;
|
||||
// window->is_tile_window = 1;
|
||||
DllQueuePushNP(panel->first_window, panel->last_window, window, next_in_panel, prev_in_panel);
|
||||
++panel->windows_count;
|
||||
}
|
||||
@ -842,6 +869,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
SpaceDfsNode *first_space_dfs = PushStruct(frame->arena, SpaceDfsNode);
|
||||
first_space_dfs->space = V.root_space;
|
||||
|
||||
//- Iterate spaces
|
||||
while (first_space_dfs)
|
||||
{
|
||||
SpaceDfsNode *space_dfs = first_space_dfs;
|
||||
@ -867,21 +895,27 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
}
|
||||
space_dfs->cp = UI_PushCP(space_key);
|
||||
|
||||
//- Build space panels
|
||||
for (V_Panel *panel = space->first_panel; panel; panel = panel->next_in_space)
|
||||
{
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
i64 active_window_idx = ClampI64(panel->active_window_idx, 0, MaxI64(panel->windows_count - 1, 0));
|
||||
/* Build tabs */
|
||||
V_Window *window = 0;
|
||||
//- Build panel window tabs
|
||||
V_Window *active_window = 0;
|
||||
{
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildRow());
|
||||
i64 window_idx = 0;
|
||||
for (V_Window *tab_window = panel->first_window; tab_window; tab_window = tab_window->next_in_panel)
|
||||
for (V_Window *window = panel->first_window; window; window = window->next_in_panel)
|
||||
{
|
||||
if (!window->is_viewport_window)
|
||||
{
|
||||
if (window_idx == active_window_idx)
|
||||
{
|
||||
window = tab_window;
|
||||
active_window = window;
|
||||
UI_SetNext(BorderColor, VEC4(0.9, 0.5, 0.5, 1));
|
||||
}
|
||||
else
|
||||
@ -894,7 +928,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildRow());
|
||||
{
|
||||
if (tab_window->is_tile_window)
|
||||
if (window->is_tile_window)
|
||||
{
|
||||
UI_BuildLabelF("Tiles");
|
||||
}
|
||||
@ -904,29 +938,36 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
}
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
window_idx += 1;
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
/* Build active window */
|
||||
if (window)
|
||||
//- Build active panel active_window
|
||||
if (active_window && !active_window->is_viewport_window)
|
||||
{
|
||||
V_Window *window = active_window;
|
||||
UI_SetNext(BackgroundColor, VEC4(0, 0, 0, 0.5));
|
||||
UI_SetNext(BorderColor, VEC4(0.5, 0.5, 0.5, 1));
|
||||
UI_SetNext(Border, 1);
|
||||
// UI_SetNext(Width, UI_PIX(100, 1));
|
||||
// UI_SetNext(Height, UI_PIX(100, 1));
|
||||
UI_SetNext(Width, UI_GROW(1, 0));
|
||||
UI_SetNext(Height, UI_GROW(1, 0));
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
// UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
if (window->is_tile_window)
|
||||
{
|
||||
UI_SetNext(BackgroundColor, VEC4(0, 0, 0, 1));
|
||||
UI_SetNext(BorderColor, VEC4(0.5, 0.5, 0.5, 1));
|
||||
UI_SetNext(Border, 1);
|
||||
UI_SetNext(Width, UI_PIX(100, 1));
|
||||
UI_SetNext(Height, UI_PIX(100, 1));
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
// UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildRow());
|
||||
{
|
||||
// UI_BuildLabelF("Tiles");
|
||||
UI_BuildLabelF("Raaah");
|
||||
}
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -966,6 +1007,79 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
V_EndCommandsWidget(&frame->commands_widget);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- Build debug info UI
|
||||
|
||||
if (frame->show_console)
|
||||
{
|
||||
UI_Key dbg_box = UI_KeyF("Debug box");
|
||||
UI_Report dbg_rep = UI_ReportFromKey(dbg_box);
|
||||
Vec2 dbg_dims = DimsFromRng2(dbg_rep.screen_rect);
|
||||
|
||||
f32 padding = 20;
|
||||
f32 rounding = 0;
|
||||
Vec4 color = VEC4(0, 0, 0, 0.75);
|
||||
UI_SetNext(Flags, UI_BoxFlag_Floating);
|
||||
UI_SetNext(FloatingPos, VEC2(0, frame->ui_dims.y - dbg_dims.y));
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_SetNext(BackgroundColor, color);
|
||||
UI_SetNext(Rounding, UI_RPIX(rounding));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
// UI_BuildSpacer(UI_PIX(10, 1), Axis_X);
|
||||
// UI_Push(ChildAlignment, UI_Alignment_Center);
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
// UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildRow());
|
||||
{
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_X);
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
Vec2I32 tile_pos = S_TilePosFromWorldPos(frame->world_cursor);
|
||||
i32 tile_idx = S_TileIdxFromTilePos(tile_pos);
|
||||
{
|
||||
UI_BuildLabelF("Cursor world pos: %F", FmtFloat2(frame->world_cursor));
|
||||
UI_BuildLabelF("Cursor tile pos: %F", FmtSint2(tile_pos));
|
||||
UI_BuildLabelF("Cursor tile idx: %F", FmtSint(tile_idx));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, 32);
|
||||
UI_BuildLabelF("CPU:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtSint(GetGstat(NumArenas)));
|
||||
UI_BuildLabelF(" Arena memory committed: %F MiB", FmtFloat((f64)GetGstat(ArenaMemoryCommitted) / 1024 / 1024));
|
||||
UI_BuildLabelF(" Arena memory reserved: %F TiB", FmtFloat((f64)GetGstat(ArenaMemoryReserved) / 1024 / 1024 / 1024 / 1024));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, 32);
|
||||
UI_BuildLabelF("GPU:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtSint(GetGstat(NumGpuArenas)));
|
||||
UI_BuildLabelF(" Dedicated arena memory committed: %F MiB", FmtFloat((f64)GetGstat(DedicatedGpuArenaMemoryCommitted) / 1024 / 1024));
|
||||
UI_BuildLabelF(" Shared arena memory committed: %F MiB", FmtFloat((f64)GetGstat(SharedGpuArenaMemoryCommitted) / 1024 / 1024));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_X);
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- Build console UI
|
||||
|
||||
@ -1005,7 +1119,6 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
f32 fade_curve = 0.5;
|
||||
|
||||
i64 now_ns = TimeNs();
|
||||
UI_Key console_box = Zi;
|
||||
{
|
||||
UI_Push(FloatingPos, VEC2(0, 0));
|
||||
UI_SetNext(Flags, UI_BoxFlag_Floating);
|
||||
@ -1022,7 +1135,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
UI_SetNext(Width, UI_GROW(1, 0));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
}
|
||||
console_box = UI_BuildColumnEx(UI_KeyF("Console box"));
|
||||
UI_Key console_box = UI_BuildColumnEx(UI_KeyF("Console box"));
|
||||
UI_PushCP(console_box);
|
||||
{
|
||||
/* Gather display logs */
|
||||
@ -1109,76 +1222,6 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- Build debug info UI
|
||||
|
||||
if (frame->show_console)
|
||||
{
|
||||
f32 padding = 20;
|
||||
f32 rounding = 0;
|
||||
Vec4 color = VEC4(0, 0, 0, 0.75);
|
||||
UI_BuildSpacer(UI_GROW(1, 0), Axis_Y);
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
// UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_SetNext(BackgroundColor, color);
|
||||
UI_SetNext(Rounding, UI_RPIX(rounding));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
// UI_BuildSpacer(UI_PIX(10, 1), Axis_X);
|
||||
// UI_Push(ChildAlignment, UI_Alignment_Center);
|
||||
// UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
// UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildRow());
|
||||
{
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_X);
|
||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||
UI_SetNext(Height, UI_SHRINK(0, 1));
|
||||
UI_PushCP(UI_BuildColumn());
|
||||
{
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
Vec2I32 tile_pos = S_TilePosFromWorldPos(frame->world_cursor);
|
||||
i32 tile_idx = S_TileIdxFromTilePos(tile_pos);
|
||||
{
|
||||
UI_BuildLabelF("Cursor world pos: %F", FmtFloat2(frame->world_cursor));
|
||||
UI_BuildLabelF("Cursor tile pos: %F", FmtSint2(tile_pos));
|
||||
UI_BuildLabelF("Cursor tile idx: %F", FmtSint(tile_idx));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, 32);
|
||||
UI_BuildLabelF("CPU:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtSint(GetGstat(NumArenas)));
|
||||
UI_BuildLabelF(" Arena memory committed: %F MiB", FmtFloat((f64)GetGstat(ArenaMemoryCommitted) / 1024 / 1024));
|
||||
UI_BuildLabelF(" Arena memory reserved: %F TiB", FmtFloat((f64)GetGstat(ArenaMemoryReserved) / 1024 / 1024 / 1024 / 1024));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, 32);
|
||||
UI_BuildLabelF("GPU:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtSint(GetGstat(NumGpuArenas)));
|
||||
UI_BuildLabelF(" Dedicated arena memory committed: %F MiB", FmtFloat((f64)GetGstat(DedicatedGpuArenaMemoryCommitted) / 1024 / 1024));
|
||||
UI_BuildLabelF(" Shared arena memory committed: %F MiB", FmtFloat((f64)GetGstat(SharedGpuArenaMemoryCommitted) / 1024 / 1024));
|
||||
}
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_Y);
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
UI_BuildSpacer(UI_PIX(padding, 1), Axis_X);
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
UI_PopCP(UI_TopCP());
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- Process vis commands
|
||||
|
||||
|
||||
@ -183,6 +183,7 @@ Struct(V_Window)
|
||||
V_Window *prev_in_panel;
|
||||
|
||||
b32 is_tile_window;
|
||||
b32 is_viewport_window;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
BIN
src/pp/pp_vis/pp_vis_res/font/OpenSans-Regular.ttf
(Stored with Git LFS)
Normal file
BIN
src/pp/pp_vis/pp_vis_res/font/OpenSans-Regular.ttf
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -46,17 +46,21 @@ void TTF_Bootstrap(void)
|
||||
{
|
||||
hr = IDWriteFactory5_CreateRenderingParams(TTF_DW.factory, &default_rendering_params);
|
||||
}
|
||||
f32 gamma = IDWriteRenderingParams_GetGamma(default_rendering_params);
|
||||
// f32 gamma = IDWriteRenderingParams_GetGamma(default_rendering_params);
|
||||
// f32 clear_type_level = IDWriteRenderingParams_GetClearTypeLevel(default_rendering_params);
|
||||
// DWRITE_PIXEL_GEOMETRY pixel_geometry = IDWriteRenderingParams_GetPixelGeometry(default_rendering_params);
|
||||
// DWRITE_RENDERING_MODE rendering_mode = IDWriteRenderingParams_GetRenderingMode(default_rendering_params);
|
||||
f32 enhanced_contrast = IDWriteRenderingParams_GetEnhancedContrast(default_rendering_params);
|
||||
f32 clear_type_level = IDWriteRenderingParams_GetClearTypeLevel(default_rendering_params);
|
||||
hr = IDWriteFactory5_CreateCustomRenderingParams(
|
||||
hr = IDWriteFactory5_CreateCustomRenderingParams2(
|
||||
TTF_DW.factory,
|
||||
gamma,
|
||||
1.f,
|
||||
enhanced_contrast,
|
||||
clear_type_level,
|
||||
enhanced_contrast,
|
||||
0,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_DEFAULT,
|
||||
&TTF_DW.rendering_params
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED,
|
||||
(IDWriteRenderingParams2 **)&TTF_DW.rendering_params
|
||||
);
|
||||
IDWriteRenderingParams_Release(default_rendering_params);
|
||||
}
|
||||
@ -72,7 +76,6 @@ void TTF_Bootstrap(void)
|
||||
|
||||
TTF_GlyphResult TTF_RasterizeGlyphFromCodepoint(Arena *arena, u32 codepoint, ResourceKey ttf, f32 font_size)
|
||||
{
|
||||
/* TODO: handle errors */
|
||||
COLORREF bg_color = 0xFF000000;
|
||||
COLORREF fg_color = 0xFFFFFFFF;
|
||||
|
||||
|
||||
@ -12,9 +12,11 @@
|
||||
*/
|
||||
|
||||
//- GUIDs
|
||||
|
||||
DEFINE_GUID(IID_IDWriteFactory5, 0x958db99a, 0xbe2a, 0x4f09, 0xaf, 0x7d, 0x65, 0x18, 0x98, 0x03, 0xd1, 0xd3);
|
||||
|
||||
//- Interfaces
|
||||
|
||||
typedef struct IDWriteFactory { struct { void* tbl[]; }* v; } IDWriteFactory;
|
||||
typedef struct IDWriteFactory5 { struct { void* tbl[]; }* v; } IDWriteFactory5;
|
||||
typedef struct IDWriteFontFile { struct { void* tbl[]; }* v; } IDWriteFontFile;
|
||||
@ -22,12 +24,14 @@ typedef struct IDWriteInMemoryFontFileLoader { struct { void* tbl[]; }* v; } I
|
||||
typedef struct IDWriteFontFileLoader { struct { void* tbl[]; }* v; } IDWriteFontFileLoader;
|
||||
typedef struct IDWriteFontFace { struct { void* tbl[]; }* v; } IDWriteFontFace;
|
||||
typedef struct IDWriteRenderingParams { struct { void* tbl[]; }* v; } IDWriteRenderingParams;
|
||||
typedef struct IDWriteRenderingParams2 { struct { void* tbl[]; }* v; } IDWriteRenderingParams2;
|
||||
typedef struct IDWriteGdiInterop { struct { void* tbl[]; }* v; } IDWriteGdiInterop;
|
||||
typedef struct IDWriteFontSetBuilder { struct { void* tbl[]; }* v; } IDWriteFontSetBuilder;
|
||||
typedef struct IDWriteFontSetBuilder1 { struct { void* tbl[]; }* v; } IDWriteFontSetBuilder1;
|
||||
typedef struct IDWriteBitmapRenderTarget { struct { void* tbl[]; }* v; } IDWriteBitmapRenderTarget;
|
||||
|
||||
//- Enums
|
||||
|
||||
typedef enum DWRITE_FACTORY_TYPE {
|
||||
DWRITE_FACTORY_TYPE_SHARED = 0,
|
||||
DWRITE_FACTORY_TYPE_ISOLATED = 1,
|
||||
@ -72,6 +76,7 @@ typedef enum DWRITE_RENDERING_MODE {
|
||||
} DWRITE_RENDERING_MODE;
|
||||
|
||||
//- Structs
|
||||
|
||||
typedef struct DWRITE_FONT_METRICS {
|
||||
UINT16 designUnitsPerEm;
|
||||
UINT16 ascent;
|
||||
@ -85,6 +90,13 @@ typedef struct DWRITE_FONT_METRICS {
|
||||
UINT16 strikethroughThickness;
|
||||
} DWRITE_FONT_METRICS;
|
||||
|
||||
|
||||
typedef enum DWRITE_GRID_FIT_MODE {
|
||||
DWRITE_GRID_FIT_MODE_DEFAULT = 0,
|
||||
DWRITE_GRID_FIT_MODE_DISABLED = 1,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED = 2,
|
||||
} DWRITE_GRID_FIT_MODE;
|
||||
|
||||
typedef struct DWRITE_GLYPH_OFFSET {
|
||||
FLOAT advanceOffset;
|
||||
FLOAT ascenderOffset;
|
||||
@ -112,21 +124,21 @@ typedef struct DWRITE_GLYPH_METRICS {
|
||||
} DWRITE_GLYPH_METRICS;
|
||||
|
||||
//- Methods
|
||||
|
||||
static inline HRESULT IDWriteFactory5_CreateInMemoryFontFileLoader (IDWriteFactory5* this, IDWriteInMemoryFontFileLoader** newLoader) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteInMemoryFontFileLoader**))this->v->tbl[44])(this, newLoader); }
|
||||
static inline HRESULT IDWriteFactory5_RegisterFontFileLoader (IDWriteFactory5* this, IDWriteFontFileLoader* fontFileLoader) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteFontFileLoader*))this->v->tbl[13])(this, fontFileLoader); }
|
||||
static inline HRESULT IDWriteFactory5_CreateFontFace (IDWriteFactory5* this, DWRITE_FONT_FACE_TYPE fontFaceType, UINT32 numberOfFiles, IDWriteFontFile** fontFiles, UINT32 faceIndex, DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, IDWriteFontFace** fontFace) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, DWRITE_FONT_FACE_TYPE, UINT32, IDWriteFontFile**, UINT32, DWRITE_FONT_SIMULATIONS, IDWriteFontFace**))this->v->tbl[9])(this, fontFaceType, numberOfFiles, fontFiles, faceIndex, fontFaceSimulationFlags, fontFace); }
|
||||
static inline HRESULT IDWriteFactory5_CreateRenderingParams (IDWriteFactory5* this, IDWriteRenderingParams** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteRenderingParams**))this->v->tbl[10])(this, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory5_CreateCustomRenderingParams (IDWriteFactory5* this, FLOAT gamma, FLOAT enhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, IDWriteRenderingParams** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, IDWriteRenderingParams**))this->v->tbl[12])(this, gamma, enhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory5_CreateCustomRenderingParams2 (IDWriteFactory5* this, FLOAT gamma, FLOAT enhancedContrast, FLOAT grayscaleEnhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, DWRITE_GRID_FIT_MODE gridFitMode, IDWriteRenderingParams2** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, FLOAT, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, DWRITE_GRID_FIT_MODE, IDWriteRenderingParams2**))this->v->tbl[29])(this, gamma, enhancedContrast, grayscaleEnhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, gridFitMode, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory5_GetGdiInterop (IDWriteFactory5* this, IDWriteGdiInterop** gdiInterop) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteGdiInterop**))this->v->tbl[17])(this, gdiInterop); }
|
||||
static inline UINT32 IDWriteFactory5_Release (IDWriteFactory5* this) { return ((UINT32 (WINAPI*)(IDWriteFactory5*))this->v->tbl[2])(this); }
|
||||
static inline HRESULT IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(IDWriteInMemoryFontFileLoader* this, IDWriteFactory* factory, const void* fontData, UINT32 fontDataSize, IUnknown* ownerObject, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteInMemoryFontFileLoader*, IDWriteFactory*, const void*, UINT32, IUnknown*, IDWriteFontFile**))this->v->tbl[4])(this, factory, fontData, fontDataSize, ownerObject, fontFile); }
|
||||
static inline HRESULT IDWriteFontSetBuilder1_AddFontFile (IDWriteFontSetBuilder1* this, IDWriteFontFile* fontFile) { return ((HRESULT (WINAPI*)(IDWriteFontSetBuilder1*, IDWriteFontFile*))this->v->tbl[7])(this, fontFile); }
|
||||
static inline UINT32 IDWriteRenderingParams_Release (IDWriteRenderingParams* this) { return ((UINT32 (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[2])(this); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetGamma (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[3])(this); }
|
||||
static inline HDC IDWriteBitmapRenderTarget_GetMemoryDC (IDWriteBitmapRenderTarget* this) { return ((HDC (WINAPI*)(IDWriteBitmapRenderTarget*))this->v->tbl[4])(this); }
|
||||
static inline UINT32 IDWriteFontFile_Release (IDWriteFontFile* this) { return ((UINT32 (WINAPI*)(IDWriteFontFile*))this->v->tbl[2])(this); }
|
||||
static inline HRESULT IDWriteFactory5_CreateFontSetBuilder1 (IDWriteFactory5* this, IDWriteFontSetBuilder1** fontSetBuilder) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteFontSetBuilder1**))this->v->tbl[43])(this, fontSetBuilder); }static inline FLOAT IDWriteRenderingParams_GetEnhancedContrast (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[4])(this); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetClearTypeLevel (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[5])(this); }
|
||||
static inline HRESULT IDWriteFactory5_CreateFontSetBuilder1 (IDWriteFactory5* this, IDWriteFontSetBuilder1** fontSetBuilder) { return ((HRESULT (WINAPI*)(IDWriteFactory5*, IDWriteFontSetBuilder1**))this->v->tbl[43])(this, fontSetBuilder); }
|
||||
static inline void IDWriteFontFace_GetMetrics (IDWriteFontFace* this, DWRITE_FONT_METRICS* fontFaceMetrics) { ((void (WINAPI*)(IDWriteFontFace*, DWRITE_FONT_METRICS*))this->v->tbl[8])(this, fontFaceMetrics); }
|
||||
static inline UINT16 IDWriteFontFace_GetGlyphCount (IDWriteFontFace* this) { return ((UINT16 (WINAPI*)(IDWriteFontFace*))this->v->tbl[9])(this); }
|
||||
static inline HRESULT IDWriteGdiInterop_CreateBitmapRenderTarget (IDWriteGdiInterop* this, HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget** renderTarget) { return ((HRESULT (WINAPI*)(IDWriteGdiInterop*, HDC, UINT32, UINT32, IDWriteBitmapRenderTarget**))this->v->tbl[7])(this, hdc, width, height, renderTarget); }
|
||||
@ -136,8 +148,14 @@ static inline HRESULT IDWriteFontFace_GetDesignGlyphMe
|
||||
static inline HRESULT IDWriteFontFace_GetGlyphIndices (IDWriteFontFace* this, const UINT32* codePoints, UINT32 codePointCount, UINT16* glyphIndices) { return ((HRESULT (WINAPI*)(IDWriteFontFace*, const UINT32*, UINT32, UINT16*))this->v->tbl[11])(this, codePoints, codePointCount, glyphIndices); }
|
||||
static inline UINT32 IDWriteGdiInterop_Release (IDWriteGdiInterop* this) { return ((UINT32 (WINAPI*)(IDWriteGdiInterop*))this->v->tbl[2])(this); }
|
||||
static inline UINT32 IDWriteBitmapRenderTarget_Release (IDWriteBitmapRenderTarget* this) { return ((UINT32 (WINAPI*)(IDWriteBitmapRenderTarget*))this->v->tbl[2])(this); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetGamma (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[3])(this); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetEnhancedContrast (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[4])(this); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetClearTypeLevel (IDWriteRenderingParams* this) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[5])(this); }
|
||||
static inline DWRITE_PIXEL_GEOMETRY IDWriteRenderingParams_GetPixelGeometry (IDWriteRenderingParams* this) { return ((DWRITE_PIXEL_GEOMETRY (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[6])(this); }
|
||||
static inline DWRITE_RENDERING_MODE IDWriteRenderingParams_GetRenderingMode (IDWriteRenderingParams* this) { return ((DWRITE_RENDERING_MODE (WINAPI*)(IDWriteRenderingParams*))this->v->tbl[7])(this); }
|
||||
|
||||
//- Functions
|
||||
|
||||
EXTERN_C HRESULT DECLSPEC_IMPORT WINAPI DWriteCreateFactory (DWRITE_FACTORY_TYPE factoryType, const GUID* iid, void** factory) WIN_NOEXCEPT;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
Loading…
Reference in New Issue
Block a user