Fix OTS warning about `maxp.maxSizeOfInstructions`.
[ttfautohint.git] / lib / tadummy.c
blob05e7712c6208f86a209b619456446baf4736d195
1 /* tadummy.c */
3 /*
4 * Copyright (C) 2011-2022 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_StyleMetrics 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(FT_UInt glyph_index,
41 TA_GlyphHints hints,
42 FT_Outline* outline)
44 FT_Error error;
46 FT_UNUSED(glyph_index);
49 error = ta_glyph_hints_reload(hints, outline);
50 if (!error)
51 ta_glyph_hints_save(hints, outline);
53 return error;
57 const TA_WritingSystemClassRec ta_dummy_writing_system_class =
59 TA_WRITING_SYSTEM_DUMMY,
61 sizeof (TA_StyleMetricsRec),
63 (TA_WritingSystem_InitMetricsFunc)NULL, /* style_metrics_init */
64 (TA_WritingSystem_ScaleMetricsFunc)NULL, /* style_metrics_scale */
65 (TA_WritingSystem_DoneMetricsFunc)NULL, /* style_metrics_done */
67 (TA_WritingSystem_InitHintsFunc)ta_dummy_hints_init, /* style_hints_init */
68 (TA_WritingSystem_ApplyHintsFunc)ta_dummy_hints_apply /* style_hints_apply */
71 /* end of tadummy.c */