font metric calculations

19 views
Skip to first unread message

Hugo Allan García

unread,
Dec 17, 2014, 2:55:14 AM12/17/14
to tikzd...@googlegroups.com
Hi! I'm trying to do some reports with Xelatex using Open Sans Light Condensed. So I make the graphics using ggplot2 and then exporting to tikz code using tikzDevice, the problem is that all the metric calculations are performed using the LaTeX default font so the graphics dont look like they are suppose to. So question is, is there any way to tell tikzDevice to perform the calculation of width string using Open Sans Light Condensed?

I've tried with the following
options(tikzDefaultEngine = "xetex")
options(tikzXelatexPackages = c("\\usepackage{tikz}\n",
                                "\\usepackage{amsmath}",
                                "\\usepackage{amsfonts}",
                                "\\usepackage{amssymb}",
                                "\\usepackage{graphicx}",
                                "\\usepackage{pdfpages}",
                                "\\usepackage{setspace}",
                                "\\usepackage{xltxtra}",
                                "\\usepackage{enumitem}",
                                "\\usepackage[active,tightpage,xetex]{preview}\n",
                                "\\usepackage{fontspec,xunicode}\n",
                                "\\PreviewEnvironment{pgfpicture}\n",
                                "\\setlength\\PreviewBorder{0pt}\n",
                                "\\fontspec{Open Sans Condensed Light}\n",
                                "\\newfontfamily\\Bold{Open Sans Condensed Bold}",
                                "\\newfontfamily\\Sans{Open Sans}",
                                "\\newfontfamily\\Italic{Open Sans Condensed Light Italic}"))

options(tikzUnicodeMetricPackages = c("\\usepackage[T1]{fontenc}\n","\\usetikzlibrary{calc}\n",
                                      "\\usepackage{fontspec,xunicode}\n",
                                      "\\fontspec{Open Sans Condensed Light}\n",
                                      "\\usepackage[paperwidth=3.19in, paperheight=1.91in, left=0.0in, right=0.8in, top=0.0in, bottom=0.0in]{geometry}"))

options(tikzDocumentDeclaration= "\\documentclass[10pt,twoside]{book}")

Thanks in advance.

Hugo Garcia

kirill...@gmail.com

unread,
Apr 10, 2015, 4:42:20 PM4/10/15
to tikzd...@googlegroups.com
Could you please share a reproducible example?
Reply all
Reply to author
Forward
0 new messages