Specifying Fonts in R Specifying Fonts in R Paul Murrell Department of Statistics The University of Auckland This document discusses how R allows fonts to be specified. This is within the context of R's graphics engine - graphics systems, such as base graphics and grid can obviously implement their own interfaces, but the engine capabilities will limit what they are able to achieve.
Currently (R 1.5.0), the following font characteristics may be set: ps The font pointsize cex The 'character expansion' (text size = ps.cex) font The font 'face' (1=plain, 2=bold, 3=italic, 4=bold-italic) The base graphics interface provides some extensions on this, basically allowing for multiple cex and font settings to exist for different purposes (e.g., axis labels and titles). One problem with this font specification is that the graphics engine does not provide an easy way to specify a font 'family'. The windows device gets around this by allowing higher values of the font 'face' to be used to map into a text file of different fonts, but this is not a terribly clean or convenient mechanism. Another problem is that there is no way to specify a change in inter-line spacing of text (for drawing a single piece of multi-line text, e.g., 'one ntwo nthree lines') Specifications in other systems Unfortunately, there exists no well-defined and universally accepted taxonomy for classifying fonts based on their names, and terms that apply to one font family name may not be appropriate for others. (from W3C CSS2 specification) In the, the following font characteristics are allowed: Font family, Font style (normal or italic), Font variant (normal or smallcaps), Font weight (normal or bold), Font stretch (sort of like cex?), and Font size. In the fonts are specified by family and face, where face is a number basically like R's 'font', with values higher than 4 indicating other nonstandard variations on a font family (only used for Hershey fonts).
In the the TextAttribute class has fields for family, weight (bold), width (like the Font stretch in CSS2), posture (oblique), and size. Proposal What I want to do is add family and lineheight characteristics to R's font specification. I can take care of the changes to base graphics, grid, and R's graphics engine, but some general issues are: impact on users (R-level API and C-level API), and impact on device maintainers. The device maintainers would either have to make some changes or trust me to make them. R-level changes This can be quite minimal. For lineheight, this can just be ignored by base graphics for now. Even if added, it would just be an additional par value with no impact on existing code.
For family, allow the current font= number to remain, but allow as an alternative font=list(family= string, face= numberorstring ). Again, no impact on existing user code. The functions strwidth and strheight need to have arguments added to allow the specification of the font for the text being sized.
(This doesn't need to happen in grid because 'strwidth' and 'strheight' units are always relative to the current font settings.) C-level changes The new lineheight and font family information has to be passed from graphics systems to the graphics engine and from the graphics engine to the graphics devices. In other words, there need to be changes to GraphicsEngine.h and GraphicsDevice.h Here are two options for doing this:.
Simply add additional lineheight and family arguments (and possibly rename font argument to 'face') to relevant graphical primitives (e.g., GEText and devtext). For devices this would only require modifying the argument list for a couple of functions and possibly renaming 'font' to 'face'. I.e., treat the new face argument exactly like the old font argument. Lineheight would only be used in the graphics engine. Family could just be ignored until you feel like doing anything about it (although maybe could add a warning if given a non-empty family value). Change the way graphical arguments are passed to graphics engine and graphics devices more substantially; create a new gpar structure (an SEXP?) within which all graphical arguments can be passed and replace primitive-specific argument lists with a single gpar ptr argument.
All graphics primitives get all graphical arguments and just use the ones they are interested in. For devices, this would mean a change in argument list and extra code to extract graphical parameters from the generic gpar structure. I.e., more work.
The advantage would be that any future additions to the list of graphical parameters would not affect the API. Also, passing a single gpar ptr would be more efficient than the current practice of passing multiple graphical arguments. Examples Here's some concrete examples to show what the changes might look like to the user: text(1, 1, 'Works just like it does now', font=2) text(1, 1, 'Same effect as above', font=list(face='italic')) text(1, 1, 'Same effect as above', font=list(face=2)) text(1, 1, 'Change the font just for this text', font=list(family='Helvetica', face='bold-italic')) text(1:4, 1:4, paste('Font face', 1:4, 'for this text'), font=list(family='Courier New', face=1:4)) Advantages. There would be potential for devices to support changes in font family on-the-fly. Hershey vector fonts could be handled within the same mechanism as 'normal' fonts. This could lead to deprecation of vfont arguments in text et al, and no need for introduction of extra vfont arguments for grid. Could also lead to use of Hershey vector fonts in mathematical annotation, which would allow mathematical annotation on ALL devices.
Downsides. Possibly some work for device maintainers (at least for gtkDevice).
External packages which depend on new graphics API or device API would have to be recompiled and versions which run on 1.5.0 would not run on 1.6.0. This includes grid (= lattice) and gtkDevice to my knowledge. On the other hand, this is already the case due to other changes.
This is an Updated List of the Vendors now offering the BX Files for Digitized Alphabet/Font Sets they sell. This list will be updated when new Vendors come on stream. Please do not post any comments or questions to this post so we all have a complete list with out having to sort through several posts! Download here : microsoft windows download for mac free.
If you do have questions or comments please post them in the Alpha Tricks Members Question Section on our Forum. Here is the link to Alpha Tricks Members Question Section. 8 Claws and a Paw Direct Link to All 717 Digitized Alphabet/Font Sets that now include the BX files. 8Claws and a Paw has a Video about how to install the Free Version of Embrilliance Express and how to install and use their pre mapped BX Font Files at the link below. The instructions for installing the Embrilliance Express Version is very similar to installing the purchased versions of the Embrilliance software programs which require a Serial number. Applique Corner Direct Link to all Fonts that include the BX files. Please Note: August 16, 2014 Applique Corner is in the process of including the BX Files for their Fonts sets.
For this reason not all Font Sets will include the BX Files yet. So check carefully when purchasing. Baby Kay's Appliques Direct Link to the Alphabets. Bows and Clothes Direct link below to the Embroidery Fonts that include the BX Files Direct Link to the Applique Fonts that include the BX Files.
Direct link to the Font Sets that include both Embroidery and Applique Letters and the BX Files. Bunnycup Embroidery Alphabet Sets can be found in the Embroidery Designs link below. Please Note: August 29, 2014 Only New Alphabet Sets on Bunnycup will include the BX files. For Older Alphabets you will have to Request the BX files. Creative Appliques Monogra Alphabet sets that include the Bx files can be found at the link below. Please Note: Sept. 26, 2014 Creative Appliques has their first Monogram/Alphabet set up that includes the Bx files.The new Monogram is called NATURAL CIRCLE HONEYCOMB MONOGRAM EMBROIDERY ALPHABET FONT Designs by Ju Ju Direct Link to Digitized Alphabet/Font Sets.
On the Designs by Juju Blog there is a great tutorial on how to make Applique Templates for their Applique designs using Embrilliance Esstentials at the link below. Digi Stitches All Current Embroidery fonts include the BX Files. Direct Link to the Embroidery Fonts. Edie Designs Direct link to the Embroidery Fonts. Embroidery Fonts Esty Shop You will have to contact the vendor and ask for the BX Files for any Fonts you want to purchase from them. Embroidery Ocean Direct Link to Embroidery Ocean's Alphabet Pages/ Please Note: August 29, 2014 In order to purchase the Alphabet Sets from Embroidery Ocean you are required to purchase a Membership. Membership information is available at the link below.
The BX Files for some of the Alphabet Sets are only included with the PES Stitch Format when you choose and download a format for an Embroidery Ocean Alphabet. Five Star Fonts Direct Link to All Digitized Alphabet/Font Sets Great Notions Direct link to the 2 pages of BX Fonts at Great Notions. Jolson’s Designs Direct Link to Digitized Font Sets that include the Bx Files at Jolson’s Designs. Katelyn’s Kreative Stitches. Direct Link to all BX Formatted Alphabets/Font Sets. Lindee G Embroidery on Line Store Direct link all Digitized Alphabet Sets Lindee G has several Embrilliance Tutorial Videos that you can watch at the link below.
Lynnie Pinnie Direct Link to Linnie Pinnie's Embroidery Fonts Etc. Please Note: Sept 26, 2014 Linnie Pinnie Website has their first new Embroidery Font up that includes the BX files. The new Font in called Lynnie's Swirly Monogram Font and comes in 5 sizes.
Nobbie Neez Kids Direct link to the BX Fonts Please Note: The BX Font Files on Nobbie Neez Kids are being sold separately so are not included with a Stitch File format and do not show any sizes for the Fonts so you may have to contact them for size information to know they will fit your hoops. Omas Place Direct Link to Omas Alphabet Pages Here is a link to the Embrilliance Information Page on Oma's Website. Please Note: August 29, 2014 Monika of Omas Place is in the process of adding the BX Files to her Alphabet Sets. Right now she has several Alphabets that include the BX Files up and available to purchase.
Rivermill Embroidery Direct link to all Digitized Alphabet/Font Sets Sew Teri-fic Designs The following 10 Collections at Sew Teri-fic now include the BX Files. Cool Dots Alphabet bCopperplate Script Alphabet/b Curly Round Script Monograms Diamond Monograms Fun Stuff Alphabet Marquis Monograms Primitive Alphabet Redline Script Alphabet Round Monograms Round Script Monograms Stitch Away Applique Direct Link to Stitch Away Applique Embroidery Fonts that include the BX files. Stitchtopia Inc. Esty Shop Direct Link to all the Digitized Monogram Sets - Most include the BX Files now. The Itch 2 Stitch Direct Link to all Digitized Alphabet/Font Sets and Number Sets The Itch 2 Stitch has 7 Videos that show how to use their pre mapped BX fonts in the Embrilliance software or Embrilliance Express software. You can watch them at the following link below.
Tulip Embroidery Esty Shop Direct Link to the Alphabets Sets.