~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Plugins/Freetype/tt_face.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* DESCRIPTION: resources for true type faces, gliefs and metrics
5
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
6
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11
10
******************************************************************************/
12
11
 
13
12
#include "font.hpp"
34
33
  url u= tt_font_find (name);
35
34
  if (is_none (u)) return;
36
35
  char* _name= as_charp (concretize (u));
37
 
  if (ft_new_face (ft_library, _name, 0, &ft_face)) { delete[] _name; return; }
 
36
  if (ft_new_face (ft_library, _name, 0, &ft_face)) { tm_delete_array (_name); return; }
38
37
  ft_select_charmap (ft_face, ft_encoding_adobe_custom);
39
 
  delete[] _name;
 
38
  tm_delete_array (_name);
40
39
  bad_face= false;
41
40
}
42
41
 
43
42
tt_face
44
43
load_tt_face (string name) {
45
44
  bench_start ("load tt face");
46
 
  tt_face face= make (tt_face, name, new tt_face_rep (name));
 
45
  tt_face face= make (tt_face, name, tm_new<tt_face_rep> (name));
47
46
  bench_cumul ("load tt face");
48
47
  return face;
49
48
}
78
77
      return error_metric;
79
78
    FT_GlyphSlot slot= face->ft_face->glyph;
80
79
    if (ft_render_glyph (slot, ft_render_mode_mono)) return error_metric;
81
 
    metric_struct* M= new metric_struct;
 
80
    metric_struct* M= tm_new<metric_struct> ();
82
81
    fnm(i)= (pointer) M;
83
82
    int w= slot->bitmap.width;
84
83
    int h= slot->bitmap.rows;
103
102
tt_font_metric (string family, int size, int dpi) {
104
103
  string name= family * as_string (size) * "@" * as_string (dpi);
105
104
  return make (font_metric, name,
106
 
               new tt_font_metric_rep (name, family, size, dpi));
 
105
               tm_new<tt_font_metric_rep> (name, family, size, dpi));
107
106
}
108
107
 
109
108
/******************************************************************************
161
160
  string name=
162
161
    family * ":" * as_string (size) * "." * as_string (dpi) * "tt";
163
162
  return make (font_glyphs, name,
164
 
               new tt_font_glyphs_rep (name, family, size, dpi));
 
163
               tm_new<tt_font_glyphs_rep> (name, family, size, dpi));
165
164
}
166
165
 
167
166
#endif // USE_FREETYPE