Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
| 3 * Copyright (C) 2006 Apple Computer Inc. | 3 * Copyright (C) 2006 Apple Computer Inc. |
| 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 5 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 { | 218 { |
| 219 ASSERT(style); | 219 ASSERT(style); |
| 220 ASSERT(renderer); | 220 ASSERT(renderer); |
| 221 | 221 |
| 222 Document* document = renderer->document(); | 222 Document* document = renderer->document(); |
| 223 ASSERT(document); | 223 ASSERT(document); |
| 224 | 224 |
| 225 StyleResolver* styleResolver = document->styleResolver(); | 225 StyleResolver* styleResolver = document->styleResolver(); |
| 226 ASSERT(styleResolver); | 226 ASSERT(styleResolver); |
| 227 | 227 |
| 228 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified | 228 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified. |
|
Stephen Chennney
2013/07/08 13:16:28
Save a little work.
scalingFactor = 1;
if (...tex
| |
| 229 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer); | 229 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer); |
| 230 if (scalingFactor == 1 || !scalingFactor || style->fontDescription().textRen deringMode() == GeometricPrecision) { | 230 if (scalingFactor == 1 || !scalingFactor) { |
| 231 scalingFactor = 1; | 231 scalingFactor = 1; |
| 232 scaledFont = style->font(); | 232 scaledFont = style->font(); |
| 233 return; | 233 return; |
| 234 } | 234 } |
| 235 | 235 |
| 236 if (style->fontDescription().textRenderingMode() == GeometricPrecision) | |
| 237 scalingFactor = 1; | |
| 238 | |
| 236 FontDescription fontDescription(style->fontDescription()); | 239 FontDescription fontDescription(style->fontDescription()); |
| 237 | 240 |
| 238 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt). | 241 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt). |
| 239 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(d ocument, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.comput edSize(), DoNotUseSmartMinimumForFontSize)); | 242 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(d ocument, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.specif iedSize(), DoNotUseSmartMinimumForFontSize)); |
| 240 | 243 |
| 241 scaledFont = Font(fontDescription, 0, 0); | 244 scaledFont = Font(fontDescription, 0, 0); |
| 242 scaledFont.update(styleResolver->fontSelector()); | 245 scaledFont.update(styleResolver->fontSelector()); |
| 243 } | 246 } |
| 244 | 247 |
| 245 } | 248 } |
| OLD | NEW |