| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 m_lineSpacing = props.GetLineSpacing(); | 53 m_lineSpacing = props.GetLineSpacing(); |
| 54 m_xHeight = props.GetXHeight(); | 54 m_xHeight = props.GetXHeight(); |
| 55 m_unitsPerEm = 1; // FIXME! | 55 m_unitsPerEm = 1; // FIXME! |
| 56 m_lineGap = props.GetLineGap(); | 56 m_lineGap = props.GetLineGap(); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 void SimpleFontData::platformDestroy() | 60 void SimpleFontData::platformDestroy() |
| 61 { | 61 { |
| 62 delete m_smallCapsFontData; | 62 delete m_smallCapsFontData; |
| 63 m_smallCapsFontData = 0; |
| 63 } | 64 } |
| 64 | 65 |
| 65 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
cription) const | 66 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
cription) const |
| 66 { | 67 { |
| 67 if (!m_smallCapsFontData){ | 68 if (!m_smallCapsFontData){ |
| 68 FontDescription desc = FontDescription(fontDescription); | 69 FontDescription desc = FontDescription(fontDescription); |
| 69 desc.setSpecifiedSize(0.70f*fontDescription.computedSize()); | 70 desc.setSpecifiedSize(0.70f*fontDescription.computedSize()); |
| 70 const FontPlatformData* pdata = new FontPlatformData(desc, desc.family()
.family()); | 71 const FontPlatformData* pdata = new FontPlatformData(desc, desc.family()
.family()); |
| 71 m_smallCapsFontData = new SimpleFontData(*pdata); | 72 m_smallCapsFontData = new SimpleFontData(*pdata); |
| 72 } | 73 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 89 | 90 |
| 90 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const | 91 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const |
| 91 { | 92 { |
| 92 // TODO: fix this! Make GetTextExtents a method of wxFont in 2.9 | 93 // TODO: fix this! Make GetTextExtents a method of wxFont in 2.9 |
| 93 int width = 10; | 94 int width = 10; |
| 94 GetTextExtent(*m_font.font(), (wxChar)glyph, &width, NULL); | 95 GetTextExtent(*m_font.font(), (wxChar)glyph, &width, NULL); |
| 95 return width; | 96 return width; |
| 96 } | 97 } |
| 97 | 98 |
| 98 } | 99 } |
| OLD | NEW |