From 8831f761dda725296e4d2d52a4e0c77bec318ec0 Mon Sep 17 00:00:00 2001 From: "scootermorris%comcast.net" Date: Wed, 18 Jan 2006 19:15:53 +0000 Subject: [PATCH] Fix for Bug 291785: rendered text size within an svg image depends on browser text-zoom value r=tor --- layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp b/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp index 26242bad337..c52c180345b 100644 --- a/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp +++ b/layout/svg/renderer/src/cairo/nsSVGCairoGlyphMetrics.cpp @@ -300,5 +300,9 @@ nsSVGCairoGlyphMetrics::SelectFont(cairo_t *ctx) mSource->GetPresContext(getter_AddRefs(presContext)); float pxPerTwips; pxPerTwips = presContext->TwipsToPixels(); - cairo_set_font_size(ctx, font.size*pxPerTwips); + // Since SVG has its own scaling, we really don't want + // fonts in SVG to respond to the browser's "TextZoom" + // (Ctrl++,Ctrl+-) + float textZoom = presContext->TextZoom(); + cairo_set_font_size(ctx, font.size*pxPerTwips/textZoom); }