+2006-11-16 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * dvi/dvi-document.c: (dvi_document_load), (dvi_document_finalize),
+ (dvi_document_class_init), (dvi_document_init_params):
+ * dvi/mdvi-lib/font.c: (font_reference):
+
+ Add reference to subfont. Fixes bug #374277.
+
2006-11-16 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-window.c: (ev_window_create_tmp_symlink),
return FALSE;
}
+ g_mutex_lock (dvi_context_mutex);
if (dvi_document->context)
mdvi_destroy_context (dvi_document->context);
dvi_document->context = mdvi_init_context(dvi_document->params, dvi_document->spec, filename);
+ g_mutex_unlock (dvi_context_mutex);
if (!dvi_document->context) {
g_set_error (error,
dvi_document->base_height = dvi_document->context->dvi_page_h * dvi_document->context->params.vconv
+ 2 * unit2pix(dvi_document->params->vdpi, MDVI_VMARGIN) / dvi_document->params->vshrink;
- dvi_context_mutex = g_mutex_new ();
-
g_free (dvi_document->uri);
dvi_document->uri = g_strdup (uri);
dvi_document_finalize (GObject *object)
{
DviDocument *dvi_document = DVI_DOCUMENT(object);
-
+
+ g_mutex_lock (dvi_context_mutex);
if (dvi_document->context)
{
mdvi_pixbuf_device_free (&dvi_document->context->device);
mdvi_destroy_context (dvi_document->context);
}
+ g_mutex_unlock (dvi_context_mutex);
if (dvi_document->params)
g_free (dvi_document->params);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = dvi_document_finalize;
+
+ mdvi_init_kpathsea("evince", MDVI_MFMODE, MDVI_FALLBACK_FONT, MDVI_DPI);
+ mdvi_register_fonts ();
+
+ dvi_context_mutex = g_mutex_new ();
}
static gboolean
dvi_document->params->bg = 0xffffffff;
dvi_document->params->fg = 0xff000000;
-
- mdvi_init_kpathsea("evince", MDVI_MFMODE, MDVI_FALLBACK_FONT, MDVI_DPI);
-
- mdvi_register_fonts ();
}
static void
{
DviFont *font;
DviFontRef *ref;
+ DviFontRef *subfont_ref;
/* see if there is a font with the same characteristics */
for(font = (DviFont *)fontlist.head; font; font = font->next) {
}
ref = xalloc(DviFontRef);
ref->ref = font;
+
font->links++;
+ for(subfont_ref = font->subfonts; subfont_ref; subfont_ref = subfont_ref->next) {
+ /* just adjust the reference counts */
+ subfont_ref->ref->links++;
+ }
+
ref->fontid = id;
if(LIST(font) != fontlist.head) {