OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
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 14 matching lines...) Expand all Loading... |
25 namespace blink { | 25 namespace blink { |
26 | 26 |
27 enum class FontOrientation; | 27 enum class FontOrientation; |
28 | 28 |
29 class SVGTextMetrics { | 29 class SVGTextMetrics { |
30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
31 | 31 |
32 public: | 32 public: |
33 enum MetricsType { SkippedSpaceMetrics }; | 33 enum MetricsType { SkippedSpaceMetrics }; |
34 | 34 |
35 SVGTextMetrics(); | |
36 SVGTextMetrics(MetricsType); | 35 SVGTextMetrics(MetricsType); |
37 SVGTextMetrics(unsigned length, float width, float height); | 36 SVGTextMetrics(unsigned length, float width, float height); |
38 | 37 |
39 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } | 38 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } |
40 | 39 |
41 float width() const { return m_width; } | 40 float width() const { return m_width; } |
42 float height() const { return m_height; } | 41 float height() const { return m_height; } |
43 | 42 |
44 // TODO(kojii): We should store logical width (advance) and height instead | 43 // TODO(kojii): We should store logical width (advance) and height instead |
45 // of storing physical and calculate logical. crbug.com/544767 | 44 // of storing physical and calculate logical. crbug.com/544767 |
46 float advance(FontOrientation) const; | 45 float advance(FontOrientation) const; |
47 unsigned length() const { return m_length; } | 46 unsigned length() const { return m_length; } |
48 | 47 |
49 private: | 48 private: |
50 float m_width; | 49 float m_width; |
51 float m_height; | 50 float m_height; |
52 unsigned m_length; | 51 unsigned m_length; |
53 }; | 52 }; |
54 | 53 |
55 } // namespace blink | 54 } // namespace blink |
56 | 55 |
57 #endif | 56 #endif |
OLD | NEW |