.
1 /*
2 Copyright (C) 2012 Johan Mattsson
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the
7 License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13 */
14
15 using Cairo;
16 using Bird;
17
18 namespace BirdFont {
19
20 public class Kerning : GLib.Object {
21 public double val;
22 public Glyph? glyph;
23
24 public Kerning (double v) {
25 val = v;
26 glyph = null;
27 }
28
29 public Kerning.for_glyph (Glyph? g, double v) {
30 val = v;
31 glyph = g;
32 }
33
34 public Glyph get_glyph () {
35 if (unlikely (glyph == null)) {
36 warning ("No glyph");
37 return new Glyph ("");
38 }
39
40 return (!) glyph;
41 }
42 }
43
44 }
45