Editing Use a TrueType font

From LuaTeXWiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 11: Line 11:
 
   function(name, size)
 
   function(name, size)
 
     local fonttype, f
 
     local fonttype, f
     local fonttype = string.match(string.lower(name), "otf$") and "opentype"
+
 
                  or string.match(string.lower(name), "ttf$") and "truetype"
+
     filename = kpse.find_file(name, "opentype fonts")
 +
    if filename then
 +
      fonttype = "opentype"
 +
    else
 +
      filename = kpse.find_file(name, "truetype fonts")
 +
    end
 +
    if filename and not fonttype then
 +
      fonttype = "truetype"
 +
    end
  
 
     if fonttype then
 
     if fonttype then
      filename = kpse.find_file(name, "opentype fonts") or kpse.find_file(name, "truetype fonts")
 
 
       if size < 0 then
 
       if size < 0 then
 
         size = (- 655.36) * size
 
         size = (- 655.36) * size
Line 27: Line 34:
 
         f.designsize = size
 
         f.designsize = size
 
         f.size = size
 
         f.size = size
         f.direction = 0
+
         direction = 0
 
         f.parameters.slant = 0
 
         f.parameters.slant = 0
 
         f.parameters.space = size * 0.25
 
         f.parameters.space = size * 0.25

Please note that all contributions to LuaTeXWiki are considered to be released under the GNU Free Documentation License 1.3 (see LuaTeXWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)