OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 11 matching lines...) Expand all Loading... |
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "platform/fonts/SimpleFontData.h" | 30 #include "platform/fonts/SimpleFontData.h" |
31 | 31 |
| 32 #include <unicode/unorm.h> |
| 33 #include <unicode/utf16.h> |
| 34 #include <memory> |
32 #include "SkPath.h" | 35 #include "SkPath.h" |
33 #include "SkTypeface.h" | 36 #include "SkTypeface.h" |
34 #include "SkTypes.h" | 37 #include "SkTypes.h" |
35 #include "platform/fonts/FontDescription.h" | 38 #include "platform/fonts/FontDescription.h" |
36 #include "platform/fonts/VDMXParser.h" | 39 #include "platform/fonts/VDMXParser.h" |
37 #include "platform/fonts/skia/SkiaTextMetrics.h" | 40 #include "platform/fonts/skia/SkiaTextMetrics.h" |
38 #include "platform/geometry/FloatRect.h" | 41 #include "platform/geometry/FloatRect.h" |
39 #include "wtf/MathExtras.h" | 42 #include "wtf/MathExtras.h" |
40 #include "wtf/PtrUtil.h" | 43 #include "wtf/PtrUtil.h" |
41 #include "wtf/allocator/Partitions.h" | 44 #include "wtf/allocator/Partitions.h" |
42 #include "wtf/text/CharacterNames.h" | 45 #include "wtf/text/CharacterNames.h" |
43 #include "wtf/text/Unicode.h" | 46 #include "wtf/text/Unicode.h" |
44 #include <memory> | |
45 #include <unicode/unorm.h> | |
46 #include <unicode/utf16.h> | |
47 | 47 |
48 namespace blink { | 48 namespace blink { |
49 | 49 |
50 const float smallCapsFontSizeMultiplier = 0.7f; | 50 const float smallCapsFontSizeMultiplier = 0.7f; |
51 const float emphasisMarkFontSizeMultiplier = 0.5f; | 51 const float emphasisMarkFontSizeMultiplier = 0.5f; |
52 | 52 |
53 #if OS(LINUX) || OS(ANDROID) | 53 #if OS(LINUX) || OS(ANDROID) |
54 // This is the largest VDMX table which we'll try to load and parse. | 54 // This is the largest VDMX table which we'll try to load and parse. |
55 static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB | 55 static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB |
56 #endif | 56 #endif |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { | 385 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { |
386 if (!m_platformData.size()) | 386 if (!m_platformData.size()) |
387 return 0; | 387 return 0; |
388 | 388 |
389 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); | 389 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); |
390 | 390 |
391 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph); | 391 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph); |
392 } | 392 } |
393 | 393 |
394 } // namespace blink | 394 } // namespace blink |
OLD | NEW |