FAQ

From GoldenDict Wiki

(Difference between revisions)
Jump to: navigation, search
m
(Adding description of new functionality, as discussed in http://goldendict.org/forum/viewtopic.php?f=5&t=876&sid=2f0010898267c9edf02ced8fc80b484a)
 
(7 intermediate revisions not shown)
Line 2: Line 2:
__TOC__
__TOC__
 +
=== Where do I get a portable version of the program? ===
 +
As of May 28, 2010, portable mode is supported by the main version of the program. You just need to create a directory named "portable" in the program's directory. This directory will then be used to store configuration and indices. Your dictionaries should be stored in the "content" directory, and morphologies in the "content/morphologies" directory. Sound directories aren't supported in portable mode.
 +
 +
Use a recent enough Git build to have this functionality.
 +
=== 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 ''%APPDATA%\GoldenDict''. You can put arbitrary CSS code there. Example:
  body
  body
  {
  {
Line 16: Line 21:
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.
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? ===
+
=== How do I change fonts for only a 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 [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1] two-letter language code. Example:
+
Some scripts or languages (e.g. Hindi, Urdu, Bengali) are not rendered well with the default system fonts. You can specify the fonts GoldenDict uses for these languages by customizing two CSS style sheets: ''article-style.css'' (see the previous question) for changes to the main article display pane, and ''qt-style.css'' for changes to the search box and word list.
 +
 
 +
'''Article fonts''' are specified using the standard ''lang(xx)'' CSS pseudo-class, and also the special ''gdlangfrom-xx'' CSS class, where ''xx'' is an [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1] two-letter language code. The following examples can guide you in editing your ''article-style.css'':
  :lang(ru)
  :lang(ru)
  {
  {
Line 35: Line 42:
   font-size: 32px;
   font-size: 32px;
  }
  }
-
This will only apply to the articles translating from English to Russian.
+
This will only apply to the articles translating from English to Russian. And here's how to match the ''either'' one:
 +
:lang(ru), .gdlangfrom-ru
 +
{
 +
  font-family: "Sans Comic MS";
 +
  font-size: 32px;
 +
}
 +
This will match articles translating either ''from'' Russian, or ''to'' Russian.
 +
 
 +
'''Note''' that this feature is only available in the recent enough [[GIT version]] (one from April 3, 2010 or later).
 +
 
 +
'''Search box and wordlist fonts''' are specified in ''qt-style.css'' (located in the same directory as ''article-style.css'') using the ''currentGroup'' property, which corresponds to defined dictionary groups.  For example, you can change the font used for searches in a ''Bengali'' dictionary group by adding the following to your ''qt-style.css'':
 +
MainWindow #searchPane #translateLine[currentGroup="Bengali"], MainWindow #searchPane #wordList[currentGroup="Bengali"]
 +
{
 +
  background: white;
 +
  color: black;
 +
  font-family: "SolaimanLipi";
 +
  font-size: 20px;
 +
}
-
'''Note''' that this feature is only available in the recent enough [[GIT version]] (one from April 3th 2010 or later).
+
'''Note''' that this feature is only available in the recent enough [[GIT version]] (one from Nov 16, 2010 or later).

Current revision as of 06:49, 17 November 2010

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

Contents

Where do I get a portable version of the program?

As of May 28, 2010, portable mode is supported by the main version of the program. You just need to create a directory named "portable" in the program's directory. This directory will then be used to store configuration and indices. Your dictionaries should be stored in the "content" directory, and morphologies in the "content/morphologies" directory. Sound directories aren't supported in portable mode.

Use a recent enough Git build to have this functionality.

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 %APPDATA%\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 for only a specific language?

Some scripts or languages (e.g. Hindi, Urdu, Bengali) are not rendered well with the default system fonts. You can specify the fonts GoldenDict uses for these languages by customizing two CSS style sheets: article-style.css (see the previous question) for changes to the main article display pane, and qt-style.css for changes to the search box and word list.

Article fonts are specified 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. The following examples can guide you in editing your article-style.css:

: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. And here's how to match the either one:

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

This will match articles translating either from Russian, or to Russian.

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

Search box and wordlist fonts are specified in qt-style.css (located in the same directory as article-style.css) using the currentGroup property, which corresponds to defined dictionary groups. For example, you can change the font used for searches in a Bengali dictionary group by adding the following to your qt-style.css:

MainWindow #searchPane #translateLine[currentGroup="Bengali"], MainWindow #searchPane #wordList[currentGroup="Bengali"]
{
  background: white;
  color: black;
  font-family: "SolaimanLipi";
  font-size: 20px;
}

Note that this feature is only available in the recent enough GIT version (one from Nov 16, 2010 or later).

Personal tools