Support multiple scripts. [6/7]
[ttfautohint.git] / lib / tadummy.c
blobd8d67166a3cecd0673877edd535d07f6e2bf1704
1 /* tadummy.c */
3 /*
4 * Copyright (C) 2011-2013 by Werner Lemberg.
6 * This file is part of the ttfautohint library, and may only be used,
7 * modified, and distributed under the terms given in `COPYING'. By
8 * continuing to use, modify, or distribute this file you indicate that you
9 * have read `COPYING' and understand and accept it fully.
11 * The file `COPYING' mentioned in the previous paragraph is distributed
12 * with the ttfautohint library.
16 /* originally file `afdummy.c' (2011-Mar-28) from FreeType */
18 /* heavily modified 2011 by Werner Lemberg <wl@gnu.org> */
20 #include "tadummy.h"
21 #include "tahints.h"
24 static FT_Error
25 ta_dummy_hints_init(TA_GlyphHints hints,
26 TA_ScriptMetrics metrics)
28 ta_glyph_hints_rescale(hints, metrics);
30 hints->x_scale = metrics->scaler.x_scale;
31 hints->y_scale = metrics->scaler.y_scale;
32 hints->x_delta = metrics->scaler.x_delta;
33 hints->y_delta = metrics->scaler.y_delta;
35 return FT_Err_Ok;
39 static FT_Error
40 ta_dummy_hints_apply(TA_GlyphHints hints,
41 FT_Outline* outline)
43 FT_Error error;
46 error = ta_glyph_hints_reload(hints, outline);
47 if (!error)
48 ta_glyph_hints_save(hints, outline);
50 return error;
54 const TA_WritingSystemClassRec ta_dummy_writing_system_class =
56 TA_WRITING_SYSTEM_DUMMY,
58 sizeof (TA_ScriptMetricsRec),
60 (TA_Script_InitMetricsFunc)NULL,
61 (TA_Script_ScaleMetricsFunc)NULL,
62 (TA_Script_DoneMetricsFunc)NULL,
64 (TA_Script_InitHintsFunc)ta_dummy_hints_init,
65 (TA_Script_ApplyHintsFunc)ta_dummy_hints_apply
69 const TA_ScriptClassRec ta_dflt_script_class =
71 TA_SCRIPT_DFLT,
72 (TA_Blue_Stringset)0,
73 TA_WRITING_SYSTEM_DUMMY,
75 NULL,
76 '\0'
79 /* end of tadummy.c */