# Macro for changing font and its size

I'm trying out Context and have hit a bump. I need to create a macro which inserts a symbol from another font at a different size in the running text. I'm done this in XeLaTeX before but I'm having trouble doing this in Context.

The following is my MWE (ConTeXt):

\definefont[sakkal][name:Sakkal Majalla at 36pt]

\def\mySakkal{{\sakkal TEST}}

\starttext

This is normal text and this is \mySakkal{} which should be bigger.

\stoptext


The font does change but the font size does not. My ConTeXt version is 2016.05.17 19:20.

For reference, here is the MWE in in XeLaTeX:

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}

\newfontfamily\sakkalfont[
Script=Arabic,%
Numbers=Proportional,%
Scale=2.0,%
]{Sakkal Majalla}

\newcommand{\mySakkal}{{\sakkalfont{TEST}}}

\begin{document}
This is regular text and this is \mySakkal{} which should be bigger.
\end{document}


The following is the results of both.

• Your example gives the expected result here with the latest context version (2016.11.04 20:50), the fontsize changes. Which version are you using? Btw, you can scale the font relative to its surrounding size with the syntax \definefont[sakkal][name:Sakkal Majalla sa 1.2] (I assume that's what you xelatex syntax does, though I am not sure). – Thomas Nov 17 '16 at 11:21
• Thanks for the suggestions, I've updated the MWE to show both and also the output for each. My ConTeXt version is 2016.05.17 19:20. I'm using TeXLive 2016. – Khalid Hussain Nov 17 '16 at 12:10
• @KhalidHussain The ConTeXt releases don't necessarily make it into TeX Live: you are best grabbing their 'minimals' distribution – Joseph Wright Nov 17 '16 at 12:14
• @JosephWright, whose 'minimals'? TeX Live or ConTeXt? I'm going to try updating TeX Live to see if that helps. – Khalid Hussain Nov 17 '16 at 12:21
• @KhalidHussain wiki.contextgarden.net/ConTeXt_Standalone As I said, ConTeXt releases don't necessarily go into TL (They don't go to CTAN). – Joseph Wright Nov 17 '16 at 12:22

I tested your example with ConTeXt from texlive, and I get the expected output again. Are you sure ConTeXt finds your font file?Here is my output, with indication of the version used (I use the file syntax for specifying the font instead of name because I didn't want to install it, but that shouldn't make any difference):

• Just tried out your method. Yes it works if I use file instead of name. I copied the font out of the Fonts folder and tested it. That's weird. – Khalid Hussain Nov 17 '16 at 13:20

The devil is in the details.

After spending mobile bandwidth downloading the latest ConTeXt and just barely getting it running, I was met with the same problem.

The space in the middle of the font name was causing the problem.

The following works perfectly:

\definefont[sakkal][name:SakkalMajalla at 36pt]

\def\mySakkal{{\sakkal TEST}}

\starttext

This is normal text and this is \mySakkal{} which should be bigger.

\stoptext