OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * | 3 * |
4 * Copyright (C) 1999-2013, International Business Machines | 4 * Copyright (C) 1999-2014, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * file name: SimpleFontInstance.cpp | 8 * file name: SimpleFontInstance.cpp |
9 * | 9 * |
10 * created on: 03/30/2006 | 10 * created on: 03/30/2006 |
11 * created by: Eric R. Mader | 11 * created by: Eric R. Mader |
12 */ | 12 */ |
13 | 13 |
14 #include "unicode/utypes.h" | 14 #include "unicode/utypes.h" |
15 #include "unicode/uchar.h" | 15 #include "unicode/uchar.h" |
16 | 16 |
17 #include "layout/LETypes.h" | 17 #include "layout/LETypes.h" |
18 #include "layout/LEFontInstance.h" | 18 #include "layout/LEFontInstance.h" |
19 | 19 |
| 20 #ifndef USING_ICULEHB |
20 #include "CanonShaping.h" | 21 #include "CanonShaping.h" |
| 22 #endif |
| 23 |
21 #include "SimpleFontInstance.h" | 24 #include "SimpleFontInstance.h" |
22 | 25 |
23 SimpleFontInstance::SimpleFontInstance(float pointSize, LEErrorCode &status) | 26 SimpleFontInstance::SimpleFontInstance(float pointSize, LEErrorCode &status) |
24 : fPointSize(pointSize), fAscent(0), fDescent(0) | 27 : fPointSize(pointSize), fAscent(0), fDescent(0) |
25 { | 28 { |
26 if (LE_FAILURE(status)) { | 29 if (LE_FAILURE(status)) { |
27 return; | 30 return; |
28 } | 31 } |
29 | 32 |
30 fAscent = (le_int32) yUnitsToPoints(2000.0); | 33 fAscent = (le_int32) yUnitsToPoints(2000.0); |
31 fDescent = (le_int32) yUnitsToPoints(600.0); | 34 fDescent = (le_int32) yUnitsToPoints(600.0); |
32 | 35 |
33 return; | 36 return; |
34 } | 37 } |
35 | 38 |
36 SimpleFontInstance::~SimpleFontInstance() | 39 SimpleFontInstance::~SimpleFontInstance() |
37 { | 40 { |
38 // nothing to do... | 41 // nothing to do... |
39 } | 42 } |
40 | 43 |
41 const void *SimpleFontInstance::getFontTable(LETag tableTag) const | 44 const void *SimpleFontInstance::getFontTable(LETag tableTag) const |
42 { | 45 { |
| 46 #ifndef USING_ICULEHB |
43 if (tableTag == LE_GSUB_TABLE_TAG) { | 47 if (tableTag == LE_GSUB_TABLE_TAG) { |
44 return CanonShaping::glyphSubstitutionTable; | 48 return CanonShaping::glyphSubstitutionTable; |
45 } | 49 } |
46 | 50 |
47 if (tableTag == LE_GDEF_TABLE_TAG) { | 51 if (tableTag == LE_GDEF_TABLE_TAG) { |
48 return CanonShaping::glyphDefinitionTable; | 52 return CanonShaping::glyphDefinitionTable; |
49 } | 53 } |
50 | 54 #endif |
51 return NULL; | 55 return NULL; |
52 } | 56 } |
53 | 57 |
54 void SimpleFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) cons
t | 58 void SimpleFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) cons
t |
55 { | 59 { |
56 #if 0 | 60 #if 0 |
57 if (u_getCombiningClass((UChar32) glyph) == 0) { | 61 if (u_getCombiningClass((UChar32) glyph) == 0) { |
58 advance.fX = xUnitsToPoints(2048); | 62 advance.fX = xUnitsToPoints(2048); |
59 } else { | 63 } else { |
60 advance.fX = 0; | 64 advance.fX = 0; |
61 } | 65 } |
62 #else | 66 #else |
| 67 (void)glyph; // Suppress unused parameter compiler warning. |
63 advance.fX = xUnitsToPoints(2048); | 68 advance.fX = xUnitsToPoints(2048); |
64 #endif | 69 #endif |
65 | 70 |
66 advance.fY = 0; | 71 advance.fY = 0; |
67 } | 72 } |
68 | 73 |
69 le_int32 SimpleFontInstance::getUnitsPerEM() const | 74 le_int32 SimpleFontInstance::getUnitsPerEM() const |
70 { | 75 { |
71 return 2048; | 76 return 2048; |
72 } | 77 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 float SimpleFontInstance::getScaleFactorY() const | 128 float SimpleFontInstance::getScaleFactorY() const |
124 { | 129 { |
125 return 1.0; | 130 return 1.0; |
126 } | 131 } |
127 | 132 |
128 le_bool SimpleFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointN
umber*/, LEPoint &/*point*/) const | 133 le_bool SimpleFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointN
umber*/, LEPoint &/*point*/) const |
129 { | 134 { |
130 return FALSE; | 135 return FALSE; |
131 } | 136 } |
132 | 137 |
OLD | NEW |