# Hyperref font selection problem with babel and french

How one can change font in the text form?

\documentclass{standalone}

\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english,russian,french]{babel}
\usepackage{hyperref}

\begin{document}
\pagestyle{empty}
\begin{Form}
\TextField[bordercolor=white
,borderwidth=0
,width=2.5in
,name=name.1
,format={
var f = this.getField('name.1');
f.textFont = 'Europe';
}
,value=something
,charsize=7pt]{Type:}
\end{Form}
\end{document}


This example is not working. If I open the Adobe Acrobat Pro it says that the forms font is helvetica. If I change \usepackage[english,russian,french]{babel} to \usepackage[english]{babel} or \usepackage[russian]{babel} everything works.

-
Do you have this font installed? I tried with other fonts (like Consolas or Times New Roman) it worked. –  m0nhawk Feb 22 '13 at 8:43
Yes, I have this font installed. –  Ptech Feb 22 '13 at 8:48
I've updated code, so that it represents the question. I found that the problem with french in babel. –  m0nhawk Feb 22 '13 at 9:26
Not only french, when I add one more lang to babel this textfont format function not works. –  Ptech Feb 22 '13 at 9:39
@Ptech The \select@language error is normal when you change options for babel and will vanish at the next LaTeX run, provided you don't interrupt the present one. –  egreg Feb 22 '13 at 10:11

Package babel uses shorthand characters for different languages. Example, ; is redefined as active character if french is loaded to insert some space before according to French typography.

With \shorthandoff and \shorthandon a shorthand character can be dis- and enabled:

\shorthandoff{;}%
\TextField...
\shorthandon{;}%


Another possibility is the use of \string (or e-TeX's \detokenize). \string converts the next token to a character with catcode "other" (12, such as digits) or "space" (10) if the token has the character code of a space (32).

\TextField[...
format={... f.textFont = 'Europe'\string; ...},
....]{...}


Another problem is font embedding. The font is only referenced by name and must be installed at the system of the user.

-
For me only the \shorthandoff/\shorthandon way works. Using pdflatex. –  m0nhawk Feb 23 '13 at 18:19