Skip to content

Commit

Permalink
rewrote ft2font using cxx
Browse files Browse the repository at this point in the history
svn path=/trunk/matplotlib/; revision=334
  • Loading branch information
jdh2358 committed Jun 8, 2004
1 parent 179ca0c commit 8b48580
Show file tree
Hide file tree
Showing 6 changed files with 297 additions and 77 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
New entries should be added at the top

2004-06-08 Rewrote ft2font using CXX as part of general memory leak
fixes - JDH

2004-06-07 Fixed several problems with log ticks and scaling - JDH

2004-06-07 Fixed width/height issues for images - JDH
Expand All @@ -16,7 +19,6 @@ New entries should be added at the top

2004-05-31 Added renderer markeredgewidth attribute of Line2D. - ADS


2004-05-29 Fixed tick label clipping to work with navigation.

2004-05-28 Added renderer grouping commands to support groups in
Expand Down
15 changes: 8 additions & 7 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def add_gd_flags(module):

def add_ft2font_flags(module):
'Add the module flags to build extensions which use gd'
module.libraries.extend(['freetype', 'z'])
module.libraries.extend(['freetype', 'z' ])
add_base_flags(module)

basedirs = module.include_dirs[:] # copy the list to avoid inf loop!
Expand All @@ -114,7 +114,7 @@ def add_ft2font_flags(module):
module.libraries.append('gw32c')

# put this last for library link order
module.libraries.append('m')
module.libraries.extend(['stdc++', 'm'])



Expand Down Expand Up @@ -245,10 +245,11 @@ def build_windowing(ext_modules, packages):
def build_ft2font(ext_modules, packages):
global BUILT_FT2FONT
if BUILT_FT2FONT: return # only build it if you you haven't already
module = Extension('matplotlib.ft2font',
['src/ft2font.c',
],
)
deps = ['src/ft2font.cpp']
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))

module = Extension('matplotlib.ft2font', deps)
add_ft2font_flags(module)
ext_modules.append(module)
BUILT_FT2FONT = True
Expand Down Expand Up @@ -301,7 +302,7 @@ def build_agg(ext_modules, packages):
global BUILT_AGG
if BUILT_AGG: return # only build it if you you haven't already

deps = ['src/_backend_agg.cpp', 'src/ft2font.c']
deps = ['src/_backend_agg.cpp', 'src/ft2font.cpp']
deps.extend(glob.glob('agg2/src/*.cpp'))
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))
Expand Down
3 changes: 2 additions & 1 deletion src/_backend_agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ RendererAgg::draw_text(const Py::Tuple& args) {
args.verify_length(4);


FT2FontObject *font = (FT2FontObject *)args[0].ptr();
FT2Font *font = static_cast<FT2Font*>(args[0].ptr());

int x = Py::Int( args[1] );
int y = Py::Int( args[2] );
Expand Down Expand Up @@ -918,6 +918,7 @@ RendererAgg::write_rgba(const Py::Tuple& args) {
Py::Object
RendererAgg::write_png(const Py::Tuple& args)
{
//small memory leak in this function - JDH 2004-06-08
if (debug)
std::cout << "RendererAgg::write_png" << std::endl;

Expand Down
Loading

0 comments on commit 8b48580

Please sign in to comment.