• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revisãoa913f6f6a49fe0b41efed1ab1a951156e0f3c746 (tree)
Hora2009-08-20 02:11:31
AutorHans Breuer <hans@breu...>
CommiterHans Breuer

Mensagem de Log

Bug #591403 - allow DiaCairoRenderer::set_font() even before call to begin()

Mudança Sumário

Diff

--- a/plug-ins/cairo/diacairo-renderer.c
+++ b/plug-ins/cairo/diacairo-renderer.c
@@ -305,10 +305,6 @@ static void
305305 set_font(DiaRenderer *self, DiaFont *font, real height)
306306 {
307307 DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
308-#ifndef HAVE_PANGOCAIRO_H
309- DiaFontStyle style = dia_font_get_style (font);
310- const char *family_name;
311-#endif
312308 /* pango/cairo wants the font size, not the (line-) height */
313309 real size = dia_font_get_size (font) * (height / dia_font_get_height (font));
314310
@@ -321,18 +317,21 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
321317 pango_layout_set_font_description (renderer->layout, pfd);
322318 pango_font_description_free (pfd);
323319 #else
324- family_name = dia_font_get_family(font);
325-
326- cairo_select_font_face (
327- renderer->cr,
328- family_name,
329- DIA_FONT_STYLE_GET_SLANT(style) == DIA_FONT_NORMAL ? CAIRO_FONT_SLANT_NORMAL : CAIRO_FONT_SLANT_ITALIC,
330- DIA_FONT_STYLE_GET_WEIGHT(style) < DIA_FONT_MEDIUM ? CAIRO_FONT_WEIGHT_NORMAL : CAIRO_FONT_WEIGHT_BOLD);
331- cairo_set_font_size (renderer->cr, size);
320+ if (renderer->cr) {
321+ DiaFontStyle style = dia_font_get_style (font);
322+ const char *family_name = dia_font_get_family(font);
323+
324+ cairo_select_font_face (
325+ renderer->cr,
326+ family_name,
327+ DIA_FONT_STYLE_GET_SLANT(style) == DIA_FONT_NORMAL ? CAIRO_FONT_SLANT_NORMAL : CAIRO_FONT_SLANT_ITALIC,
328+ DIA_FONT_STYLE_GET_WEIGHT(style) < DIA_FONT_MEDIUM ? CAIRO_FONT_WEIGHT_NORMAL : CAIRO_FONT_WEIGHT_BOLD);
329+ cairo_set_font_size (renderer->cr, size);
330+
331+ DIAG_STATE(renderer->cr)
332+ }
332333 #endif
333334
334- DIAG_STATE(renderer->cr)
335-
336335 /* for the interactive case we must maintain the font field in the base class */
337336 if (self->is_interactive) {
338337 dia_font_ref(font);