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

Re: [g-i] fonts: a few thoughts



Hidetaka Iwai wrote:
Hi,

Attilio Fiandrotti <fiandro@tiscalinet.it> wrote:
Message-ID: <[🔎] 43D35CC3.9080200@tiscalinet.it>

I think that the localechooser patch should be further modified for the case the user switches back from one of the languages that need special fonts to one of the many languages (the most part) that do not need specific fonts (see lines beginning with '>').

(snip)

>	*)
>	    echo 'gtk-font-name = "FreeSans 12"' > /etc/gtk-2.0/gtkrc
>	    ;;


I agreed.  This would be better.

ok, the combined patch is included at the bottom of the line.
As we may want to switch in the future to different screen resolutions, i've added the GTK_FONT_DEAFUALT_SIZE to the patch (this may be useful for those special scripts like persian that seem to be needing slightly bigger characters ). Note that, for some reason i don't understand, GTK 2.8.x libs render bigger fonts than GTK 2.0.x (even if the same GTK_DEFAULT_FONT_SIZE is specified), so in the future we may need to tune the default GTK font size. Frans, Christian: if Hidetaka's patch is ok for you, would you please commit? On the GTK frontend size i've made it able to parse the gtkrc file at runtime.

ciao

Attilio


Index: localechooser
===================================================================
--- localechooser       (revisione 34296)
+++ localechooser       (copia locale)
@@ -278,6 +278,39 @@
        esac
 fi

+# this font size is good for 640x480 or 800x600 screens
+GTK_FONT_DEAFULT_SIZE=12
+
+# store the current GTK theme name to restore it later
+CURRENT_THEME=$(grep gtk-theme-name /etc/gtk-2.0/gtkrc)
+
+# set the primary GTK font accroding to $LANGUAGE
+if [ "$DEBIAN_FRONTEND" = "gtk" ]; then
+    case "$LANGUAGE" in
+       ja)
+ echo 'gtk-font-name = "Sazanami Gothic '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+            ;;
+       zh)
+ echo 'gtk-font-name = "AR PL ShanHeiSun Uni '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+            ;;
+       ko)
+ echo 'gtk-font-name = "UnDotum '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+            ;;
+       ar)
+ echo 'gtk-font-name = "ae_AlMohanad '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+           ;;
+       fa)
+ echo 'gtk-font-name = "Nazli '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+           ;;
+       *)
+ echo 'gtk-font-name = "FreeSans '$GTK_FONT_DEAFULT_SIZE'"' > /etc/gtk-2.0/gtkrc
+           ;;
+    esac
+
+    # restoring the current GTK theme
+    echo $CURRENT_THEME >> /etc/gtk-2.0/gtkrc
+fi
+
 # BEGIN COUNTRY SELECTION

 # This is needed later in the script



Reply to: