Task #2342

Charts engine, set/fix default font preference

Ajouté par Sebastien Jacquot il y a plus de 7 ans. Mis à jour il y a presque 7 ans.

Statut:Closed Début:10/04/2017
Priorité:Normal Echéance:
Assigné à:- % réalisé:

100%

Catégorie:Charts Temps passé: -
Version cible:TXM 0.8.0

Description

**Set/test/fix default font preference for charts viewing but also export. At least 3 possible ways:
- find and set a portable Unicode font installed on all OS
- embed a free portable Unicode font in setups
- detect client OS and set 3 different fonts according to the current client

See if using the default Eclipse SWT font is interesting, required.

Location: /org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java
See the fixme above.

preferences.putBoolean(ChartsEnginePreferences.SHOW_TITLE, true);
preferences.putBoolean(ChartsEnginePreferences.SHOW_LEGEND, true);
preferences.putBoolean(ChartsEnginePreferences.SHOW_GRID, true);
preferences.putInt(ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEngine.RENDERING_COLORS_MODE);
preferences.put(ChartsEnginePreferences.MONOCHROME_COLOR, "0,220,20"); //$NON-NLS-1$

// FIXME: maybe need need to check here the target OS and set a default unicode installed font
preferences.put(FONT, "1|Lucida Sans Unicode|11.0|0|WINDOWS|1|-16|0|0|0|400|0|0|0|0|3|2|1|34|Lucida Sans Unicode;"); //$NON-NLS-1$

Historique

#1 Mis à jour par Sebastien Jacquot il y a plus de 7 ans

  • Description mis à jour (diff)

#2 Mis à jour par Sebastien Jacquot il y a plus de 7 ans

  • Version cible changé de TXM 0.8.0a (split/restructuration) à TXM 0.8.0

#3 Mis à jour par Sebastien Jacquot il y a presque 7 ans

  • Description mis à jour (diff)

It seems there is a bug in SWT/JFace under Linux that doesn't load the JVM embedded fonts in JFace. A manual loading has been added at TXM start for Linux. Then the default font is set this way:

        // Check the target OS and set the default font from the JVM embedded font
        String defaultFont; 
        if(OSDetector.isFamilyUnix())    {
            defaultFont = "1|Lucida Sans|11.0|0|GTK|1|"; //$NON-NLS-1$ other version: "1|Lucida Sans|11|0" 
        }
        else    {
            defaultFont = "1|Lucida Sans Unicode|11.0|0|WINDOWS|1|-16|0|0|0|400|0|0|0|0|3|2|1|34|Lucida Sans Unicode;"; //$NON-NLS-1$
        }

Is seems the fonts are well loaded on Win and Mac.

Validation tests

- launch TXM fresh install
- go to Preferences\TXM\Advanced\Charts Engine
- you should have a "Change" button that opens a font selection popup
- click on it
=> the popup must open with the Lucida font selected:
=> on Windows and Mac => "Lucida Sans Unicode"
=> on Linux => "Lucida Sans"

#4 Mis à jour par Sebastien Jacquot il y a presque 7 ans

  • Catégorie changé de Development à Charts
  • Statut changé de In Progress à Closed
  • % réalisé changé de 10 à 100

Duplicate of #2074

Formats disponibles : Atom PDF