• Skip to content
  • Skip to link menu
The KOffice Project
  • KOffice Homepage / KWord / Euro Sign
 

KWord Euro Sign

This is an attempt at providing clues about how to type and render the Euro sign. In fact the information provided here isn't specific to KWord, the same applies to any X application.

The Euro problem is a three-fold problem: key combination, character conversion, and rendering.

Assigning a key combination to the Euro sign:

You obviously need to map one of your keys - or a combination of keys - to the EuroSign symbol. A commonly chosen key combination is AltGr + E. The instructions below explain how to map that key combination, but you can choose any other one you like, for instance if you don't have an AltGr key :)

Under X (the graphical system you're using), this means the Mode_switch modifier (to be mapped to AltGr) with the E key (keycode 26), to be mapped to the EuroSign symbol.

In fact it might be good to start by checking if you don't already have a key assigned to the euro sign. Type xmodmap -pke | grep EuroSign to find out.

If nothing appeared, we are going to map it to AltGr+E.
First check you have AltGr bound to the Mode_switch modifier:
xmodmap should show a line with mod3 Mode_switch. If it doesn't have anything for mod3, type xmodmap -e 'add mod3 = Mode_switch'. If it shows something else for mod3, you might have to type xmodmap -e 'clear mod3' first.

Then check what the E key can generate:
xmodmap -pke | grep -w 26 will probably show keycode 26 = e E. If that's the case, simply ask for EuroSign as the 3rd symbol on this key, by typing xmodmap -e 'keycode 26 = e E EuroSign'

This should be all you need to bind AltGr+E to the EuroSign symbol. All the xmodmap commands we have typed here are only for the current X session, so if anything goes wrong you can restart X and find the original keys again. To make those changes permanent, put the xmodmap lines (what was between the single quotes) in your ~/.Xmodmap file. Mine reads:

keycode 26 = e E EuroSign

It seems that kxkb (the "International Keyboard" KDE application that docks into the panel) overrides the xmodmap changes. So the best is to simply disable kxkb (there is a checkbox in its control module). Or run xmodmap ~/.Xmodmap from a terminal before use, but every keymap-switching in kxkb will lose this.

If everything fails and you don't manage to make AltGr+E work, you can always use the "Character picker" applet in kicker (the panel), or application-specific "Insert special character" dialogs.

Character conversion:

Another thing to do is to select a locale (usually language and country) which provides a character the Euro symbol. Check your /usr/locale or /usr/share/locale directory, where all the locales are. In my case I selected fr_FR@euro. The first bit is the language (in this case French), the second bit is the country (in this case FR for France), and the '@euro' is a variant of that locale, that provides the euro symbol. If you can't find any relevant locales, make sure you installed the appropriate package (under Mandriva and probably RedHat, it's locales-fr for instance).
To select a locale, add

export LC_ALL="fr_FR@euro"

to ~/.bashrc (assuming you are using bash). Somehow KDE should export LC_ALL itself, this is the same problem as the non-latin1 users, and still under debate... If you see "Qt: Locales not supported on X server" after setting LC_ALL, it means that your X server doesn't support this locale. You may have to restart X, or choose another value for LC_ALL.
Another way is to use the iso8859-15 charset, which is probably a better longterm solution. However, this might reduce the number of available fonts, on a standard linux system. In that case, prefer the @euro solution, if you have such a locale, since it allows to keep the latin1 (iso8859-1) charset. If you have unicode fonts, then select iso8859-15.
Jarno Elonen pointed me to the fact that both (@euro and the locale name) can be combined. For instance he sets: LANG=fi_FI@euro.ISO8859-15
LC_ALL=fi_FI@euro
I must admit I don't know yet how this really works, and what should really be set. Any additional input appreciated.

Rendering the Euro sign:

To actually see a Euro sign, you need a font that contains it. If you got font anti-aliasing to work, you are lucky. The Arial font and many other fonts will provide the Euro sign for you. The presence of Xft makes font handling much easier, and solves many problems. Xft (v1) is being used by Qt 3 when available, and the RENDER extension (of XFree86) is available as well.
If you don't have anti-aliasing, you need to use a font that provides this symbol. According to my experiences, a nice font to use is "clearlyu". Another that provides it is the "fixed" font, but not always (the symbol only appears after zooming, or after reloading the document...). Very strange.

To test the rendering of the Euro symbol without the need for the previous two steps, KWord provides a test document under koffice/kword/demos called eurosign.kwd, where you can see if the rendering bit works.

Any input in this domain will be very appreciated. I know the keyboard issue quite well (having written X11-keyboard-related code in the past), but not much about the locale and font issues. If you know a simpler way to do all this, please drop me an e-mail :)

Inform

Skip menu "Inform"
  • Home
  • KDE Home
  • News
  • Information
  • FAQ
  • Add-ons for KOffice
  • People
  • Mailing Lists
  • Support KOffice

Latest Releases

Skip menu "Latest Releases"
  • KOffice 1.6.3
  • KOffice 2.0-alpha-6
  • Security

KOffice Applications

Skip menu "KOffice Applications"
  • KOffice Workspace
  • KWord
    • Information
    • Screenshots
    • Features
    • Templates
    • Euro Sign
    • Screenshots (1.3)
    • HandBook
    • More Info
  • KSpread
  • KPresenter
  • Kexi
  • Kivio
  • Karbon14
  • Krita
  • KPlato
  • KChart
  • KFormula
  • Kugar

Documentation

Skip menu "Documentation"
  • KOffice 1.6.3
  • Supported File Formats

Competitions

Skip menu "Competitions"
  • Recent Competitions
  • KOffice2 Design

Download

Skip menu "Download"
  • Download

Development

Skip menu "Development"
  • Developer Resources
  • Get Involved
  • KOffice Sprints

Global navigation links

  • KDE Home
  • KDE Accessibility Home
  • Description of Access Keys
  • Back to content
  • Back to menu
Maintained by koffice.org Web Team
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal