[gnome-cyr] Re: [gnome-cyr] Re: [gnome-cyr] Наутилус - обобщение



На Вск, 01 Апр 2001 00:12:41 Timur I. Bakeyev написал:
> Я тут получил еще вот такой совет:
> 
> [20:49] <Carbamide> BaT:  Ok.  Do you know how to add fonts to X? 
> If you do,
>         do the same thing with those fonts in the ~/.nautilus/fonts
> folder and
>         see if that works.  If it does, then file a bug about it not
> picking
>         up the correct fonts, if it doesn't work, file a bug about
> Nautilus
> 	not working the ru_RU locale
> 
> Попробуйте, кто может - перепишет ли это default fonts. 
> 
Итак, я создал ~/.nautilus/fonts, загнал туда работающие русские
шрифты, сделал
xset +fp ~/.nautilus/fonts
В Нау записал родные шрифты, убил Нау, запустил Нау - результат
????????

Да и откуда ему нормальному взяться? Разве в функции ниже default фонт
как-то "умно" ищется? Нет, тупо первый попавшийся.

> 
> А вот и пресловутые зашитые шрифты...
> 
> <CODE>
> libnautilus-extensions/nautilus-font-manager.c:
> 
> char *
> nautilus_font_manager_get_default_font (void)
> {
> 	guint i;
> 
> 	/* FIXME bugzilla.eazel.com 7343:
> 	 * We want this to work in the case where nautilus has
> 	 * not undergone 'make install'.  In order to do that
> 	 * we need to find out our fully qualified pwd - 
> 	 * probably using a configure.on NAUTILUS_PWD=`pwd`
> 	 * hack of some kind.  For now, commenting this out
> 	 * to make checks work in tinderbox again.
> 	 */
> 	static const char *default_fonts[] = {
> 		DEFAULT_FONT_DIRECTORY "/n019003l.pfb",
> 		/* SOURCE_DATADIR "/fonts/urw/n019003l.pfb", */
> 		"/usr/share/fonts/default/Type1/n019003l.pfb",
> 		"/usr/X11R6/lib/X11/fonts/Type1/lcdxsr.pfa"
> 	};
> 
> 	for (i = 0; i < NAUTILUS_N_ELEMENTS (default_fonts); i++) {
> 		if (g_file_exists (default_fonts[i])) {
> 			return g_strdup (default_fonts[i]);
> 		}
> 	}
> 
> 	return NULL;
> }
> 
> char *
> nautilus_font_manager_get_default_bold_font (void)
> {
> 	guint i;
> 
> 	static const char *default_bold_fonts[] = {
> 		DEFAULT_FONT_DIRECTORY "/n019004l.pfb",
> 		"/usr/share/fonts/default/Type1/n019003l.pfb",
> 		/* SOURCE_DATADIR "/fonts/urw/n019004l.pfb", */
> 	};
> 
> 	for (i = 0; i < NAUTILUS_N_ELEMENTS (default_bold_fonts);
> i++) {
> 		if (g_file_exists (default_bold_fonts[i])) {
> 			return g_strdup (default_bold_fonts[i]);
> 		}
> 	}
> 
> 	return NULL;
> }
> 
> </CODE>

А ноги у этого совета растут из вот этого куска

<CODE>
/**
 * nautilus_font_manager_for_each_font:
 * @callback: A callback to be called for each scalable font in the
system.
 * @callback_data: User's data.
 *
 * Iterate all the scalable fonts available in the system.  The
available
 * fonts are the sum of:
 *
 * 1) Fallback fonts installed by Nautilus
 * 2) User fonts found in ~/.nautilus/fonts
 * 3) Fonts listed in the font servers config file
(/etc/X11/fs/config)
 *
 */
void
nautilus_font_manager_for_each_font (NautilusFontManagerCallback
callback,
				     gpointer callback_data)
{
	GList *node;
	gboolean cont = TRUE;

 	g_return_if_fail (callback != NULL);

	/* We will be making GnomeVFS calls */
	gnome_vfs_init_if_needed ();
	
	/* Ensure that all the font tables exist */
	ensure_global_font_table ();

	for (node = global_font_table; node != NULL && cont; node =
node->next) {
		g_assert (node->data != NULL);
		cont = font_description_table_for_each (node->data,
callback, callback_data);
	}
}
</CODE>

Но это масштабируемые шрифты средствами X, кажется, а в XFree AA
появился только в 4.xx, Нау же делает AA сам, через тот же freetype2,
что и XFree, но САМ.

Дмитрий




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]