Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions test/freetype_test.c → test/test_freetype.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ main( int argc,
int target_height;
int n, num_chars;

filename = "LiberationSansBold.ttf";
filename = "LiberationSansBold.ttf";
text = "w";
num_chars = strlen( text );
WIDTH = 16;
Expand Down Expand Up @@ -143,6 +143,5 @@ main( int argc,
FT_Done_Face ( face );
FT_Done_FreeType( library );


return 0;
}
16 changes: 16 additions & 0 deletions test/test_freetype.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@




*** +***+
***+ ***** +
+**+ ***** +
+*** +**+**+ *
***+ ***+**+ +*
+**+ *** *** +*
+**++**+ +**+**
***+**+ +**+**
****** *****
+****+ +****
+****+ +****
**** ****
29 changes: 6 additions & 23 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2487,34 +2487,17 @@ def test_freetype(self):
# copy the Liberation Sans Bold truetype file located in the
# <emscripten_root>/test/freetype to the compilation folder
shutil.copy2(test_file('freetype/LiberationSansBold.ttf'), os.getcwd())
self.emcc_args += ['--embed-file', 'LiberationSansBold.ttf']
# the test program will print an ascii representation of a bitmap where the
# 'w' character has been rendered using the Liberation Sans Bold font
expectedOutput = ' \n' + \
' \n' + \
' \n' + \
' \n' + \
'*** +***+ \n' + \
'***+ ***** +\n' + \
'+**+ ***** +\n' + \
'+*** +**+**+ *\n' + \
' ***+ ***+**+ +*\n' + \
' +**+ *** *** +*\n' + \
' +**++**+ +**+**\n' + \
' ***+**+ +**+**\n' + \
' ****** *****\n' + \
' +****+ +****\n' + \
' +****+ +****\n' + \
' **** ****'
# build test program with the font file embed in it
self.do_runf('freetype_test.c', expectedOutput,
emcc_args=['-sUSE_FREETYPE', '--embed-file', 'LiberationSansBold.ttf'])
self.do_runf('freetype_test.c', expectedOutput,
emcc_args=['--use-port=freetype', '--embed-file', 'LiberationSansBold.ttf'])
# 'w' character has been rendered using the Liberation Sans Bold font.
# See test_freetype.out
self.do_run_in_out_file_test('test_freetype.c', emcc_args=['-sUSE_FREETYPE'])
self.do_run_in_out_file_test('test_freetype.c', emcc_args=['--use-port=freetype'])

@requires_network
def test_freetype_with_pthreads(self):
# Verify that freetype supports compilation requiring pthreads
self.emcc(test_file('freetype_test.c'), ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js')
self.emcc(test_file('test_freetype.c'), ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js')

@requires_network
def test_icu(self):
Expand Down
Loading