Basic FreeType renderer implementation.
[gdipp.git] / gdipp_server / ft_renderer.h
bloba00a53be6918116be9f3e8177c4268341bdc5e4b
1 #pragma once
3 #include "gdipp_server/renderer.h"
5 namespace gdipp
8 class ft_renderer : public renderer
10 public:
11 explicit ft_renderer(rpc_session *render_session);
13 private:
14 static FT_F26Dot6 get_embolden_diff(char font_weight_class, char text_weight_class);
15 static void get_font_width_height(const OUTLINETEXTMETRICW *outline_metrics, FT_Short xAvgCharWidth, FT_UInt &font_width, FT_UInt &font_height);
16 static FT_ULong make_load_flags(const render_config_static *render_config, FT_Render_Mode render_mode);
17 static void oblique_outline(const FT_Outline *outline, double slant_adv);
19 bool generate_outline_glyph(FT_Glyph *glyph,
20 WORD glyph_index,
21 const FTC_Scaler scaler,
22 FT_F26Dot6 embolden,
23 FT_ULong load_flags,
24 bool is_italic) const;
25 const FT_Glyph generate_bitmap_glyph(WORD glyph_index,
26 const FTC_Scaler scaler,
27 FT_Render_Mode render_mode,
28 FT_F26Dot6 embolden,
29 FT_ULong load_flags,
30 bool is_italic,
31 bool request_outline,
32 uint128_t render_trait) const;
33 bool generate_glyph_run(bool is_glyph_index, LPCWSTR lpString, UINT c, glyph_run *new_glyph_run, bool request_outline);
35 bool render(bool is_glyph_index, LPCWSTR lpString, UINT c, glyph_run *new_glyph_run);