| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 // VDMX parsing code. | 99 // VDMX parsing code. |
| 100 // | 100 // |
| 101 // VDMX tables are found in some TrueType/OpenType fonts and contain | 101 // VDMX tables are found in some TrueType/OpenType fonts and contain |
| 102 // ascender/descender overrides for certain (usually small) sizes. This is | 102 // ascender/descender overrides for certain (usually small) sizes. This is |
| 103 // needed in order to match font metrics on Windows. | 103 // needed in order to match font metrics on Windows. |
| 104 // | 104 // |
| 105 // Freetype does not parse these tables so we do so here. | 105 // Freetype does not parse these tables so we do so here. |
| 106 | 106 |
| 107 namespace WebCore { | 107 namespace blink { |
| 108 | 108 |
| 109 // Parse a TrueType VDMX table. | 109 // Parse a TrueType VDMX table. |
| 110 // yMax: (output) the ascender value from the table | 110 // yMax: (output) the ascender value from the table |
| 111 // yMin: (output) the descender value from the table (negative!) | 111 // yMin: (output) the descender value from the table (negative!) |
| 112 // vdmx: the table bytes | 112 // vdmx: the table bytes |
| 113 // vdmxLength: length of @vdmx, in bytes | 113 // vdmxLength: length of @vdmx, in bytes |
| 114 // targetPixelSize: the pixel size of the font (e.g. 16) | 114 // targetPixelSize: the pixel size of the font (e.g. 16) |
| 115 // | 115 // |
| 116 // Returns true iff a suitable match are found. Otherwise, *yMax and *yMin are | 116 // Returns true iff a suitable match are found. Otherwise, *yMax and *yMin are |
| 117 // untouched. size_t must be 32-bits to avoid overflow. | 117 // untouched. size_t must be 32-bits to avoid overflow. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 *yMax = tempYMax; | 193 *yMax = tempYMax; |
| 194 return true; | 194 return true; |
| 195 } | 195 } |
| 196 if (!buf.skip(2 * sizeof(int16_t))) | 196 if (!buf.skip(2 * sizeof(int16_t))) |
| 197 return false; | 197 return false; |
| 198 } | 198 } |
| 199 | 199 |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace WebCore | 203 } // namespace blink |
| OLD | NEW |