OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Brent Fulgham | 2 * Copyright (C) 2011 Brent Fulgham |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 setupPaint(&paint); | 351 setupPaint(&paint); |
352 paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); | 352 paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); |
353 | 353 |
354 uint16_t glyph; | 354 uint16_t glyph; |
355 paint.textToGlyphs(&character, sizeof(character), &glyph); | 355 paint.textToGlyphs(&character, sizeof(character), &glyph); |
356 return glyph; | 356 return glyph; |
357 } | 357 } |
358 | 358 |
359 #endif | 359 #endif |
360 | 360 |
361 #if ENABLE(OPENTYPE_VERTICAL) | |
362 PassRefPtr<OpenTypeVerticalData> FontPlatformData::verticalData() const | 361 PassRefPtr<OpenTypeVerticalData> FontPlatformData::verticalData() const |
363 { | 362 { |
364 return FontCache::fontCache()->getVerticalData(typeface()->uniqueID(), *this
); | 363 return FontCache::fontCache()->getVerticalData(typeface()->uniqueID(), *this
); |
365 } | 364 } |
366 | 365 |
367 PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const | 366 PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const |
368 { | 367 { |
369 RefPtr<SharedBuffer> buffer; | 368 RefPtr<SharedBuffer> buffer; |
370 | 369 |
371 SkFontTableTag tag = SkEndianSwap32(table); | 370 SkFontTableTag tag = SkEndianSwap32(table); |
372 const size_t tableSize = m_typeface->getTableSize(tag); | 371 const size_t tableSize = m_typeface->getTableSize(tag); |
373 if (tableSize) { | 372 if (tableSize) { |
374 Vector<char> tableBuffer(tableSize); | 373 Vector<char> tableBuffer(tableSize); |
375 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); | 374 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); |
376 buffer = SharedBuffer::adoptVector(tableBuffer); | 375 buffer = SharedBuffer::adoptVector(tableBuffer); |
377 } | 376 } |
378 return buffer.release(); | 377 return buffer.release(); |
379 } | 378 } |
380 #endif | |
381 | 379 |
382 } // namespace blink | 380 } // namespace blink |
OLD | NEW |