FAQ

From GoldenDict Wiki

(Difference between revisions)
Jump to: navigation, search
(Initial version)
Line 2: Line 2:
__TOC__
__TOC__
-
== How do I change the font used for the articles? Or alter its appearance in any other way? ==
+
=== How do I change the font used for the articles? Or alter its appearance in any other way? ===
The article text you see is actually an HTML page. It has its own CSS style which can be arbitrarily altered. To do so, you need to create a special text file ''article-style.css'', located in Linux in '''~/.goldendict''', and in Windows in '''C:\Documents and Settings\<user name>\Application Data\GoldenDict'''. You can put arbitrary CSS code there. Example:
The article text you see is actually an HTML page. It has its own CSS style which can be arbitrarily altered. To do so, you need to create a special text file ''article-style.css'', located in Linux in '''~/.goldendict''', and in Windows in '''C:\Documents and Settings\<user name>\Application Data\GoldenDict'''. You can put arbitrary CSS code there. Example:
  body
  body

Revision as of 09:38, 3 April 2010

Here we collect popular questions with answers, various tips and stuff like that. Please don't hesitate to add material here!

Contents

How do I change the font used for the articles? Or alter its appearance in any other way?

The article text you see is actually an HTML page. It has its own CSS style which can be arbitrarily altered. To do so, you need to create a special text file article-style.css, located in Linux in ~/.goldendict, and in Windows in C:\Documents and Settings\<user name>\Application Data\GoldenDict. You can put arbitrary CSS code there. Example:

body
{
  background: blue;
  font-family: Verdana;
  font-size: 16px;
}

This would change the background color of the whole page to blue, and use font Verdana, 16 pixels large. To see which attributes are available, see this file, which defines all the initial default values.

Another handy way to find the needed attributes is to save an article you would like to customize to HTML using File|Save Article, and then use Firefox with the FireBug extension or another similar tool to explore the existing attributes.

How do I change fonts only for some specific language?

Sometimes it is needed to use a different font for some specific scripts or languages which are rendered suboptimally with the default ones. Examples include Urdu, Hindi and many other ones. You can alter fonts for articles in specific languages by customizing your article-style.css file (see the previous question) using the standard lang(xx) CSS pseudo-class, and also the special gdlangfrom-xx CSS class, where xx is an ISO 639-1 two-letter language code. Example:

:lang(ru)
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

This will apply to all articles containing translations to the Russian language. Now,

.gdlangfrom-ru
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

will apply to all articles containing translations from the Russian language. You can also specify both:

.gdlangfrom-en:lang(ru)
{
  font-family: "Sans Comic MS";
  font-size: 32px;
}

This will only apply to the articles translating from English to Russian.

Note that this feature is only available in the recent enough GIT version (one from April 3th 2010 or later).

Personal tools