]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ttf.cc
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / lily / ttf.cc
index 18f1dcd0b663b4de2d0d89f547eb3171281b1ab8..02ccdb8dd430f9ae15653f328cbf96891a5f038e 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 #include <cstdio>
 #include "freetype.hh"
 
-#include <freetype/tttables.h>
+#include FT_TRUETYPE_TABLES_H
 
 #include "international.hh"
 #include "memory-stream.hh"
@@ -67,7 +67,7 @@ print_header (void *out, FT_Face face)
 
   lily_cookie_fprintf (out, "%d dict begin\n", 11);
   lily_cookie_fprintf (out, "/FontName /%s def\n",
-                       FT_Get_Postscript_Name (face));
+                       get_postscript_name (face).c_str ());
 
   lily_cookie_fprintf (out, "/Encoding StandardEncoding def\n");
   lily_cookie_fprintf (out, "/PaintType 0 def\n");
@@ -467,7 +467,7 @@ print_trailer (void *out,
 }
 
 static void
-create_type42_font (void *out, string name, int idx)
+create_type42_font (void *out, const string &name, int idx)
 {
   FT_Face face;
 
@@ -503,7 +503,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
   LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
 
   int i = 0;
-  if (idx != SCM_UNDEFINED)
+  if (!SCM_UNBNDP (idx))
     {
       LY_ASSERT_TYPE (scm_is_integer, idx, 2);
       i = scm_to_int (idx);
@@ -533,8 +533,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
     }
 
   face = open_ft_face (file_name, i);
-  char const *ps_name_str0 = FT_Get_Postscript_Name (face);
-  SCM ps_name = scm_from_locale_string (ps_name_str0 ? ps_name_str0 : "");
+  SCM ps_name = scm_from_locale_string (get_postscript_name (face).c_str ());
   FT_Done_Face (face);
 
   debug_output ("]", false);
@@ -553,7 +552,7 @@ LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa",
   LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
 
   int i = 0;
-  if (idx != SCM_UNDEFINED)
+  if (!SCM_UNBNDP (idx))
     {
       LY_ASSERT_TYPE (scm_is_integer, idx, 2);
       i = scm_to_int (idx);
@@ -570,7 +569,7 @@ LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa",
   Memory_out_stream stream;
 
   create_type42_font (&stream, file_name, i);
-  SCM asscm = scm_from_locale_stringn (stream.get_string (),
+  SCM asscm = scm_from_latin1_stringn (stream.get_string (),
                                        stream.get_length ());
 
   debug_output ("]", false);