forked from esy-packages/esy-harfbuzz
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test program + fix build on all platforms
Add test program + fix build on all platforms
- Loading branch information
Showing
1,030 changed files
with
209 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ install: | |
- npm install --global [email protected] | ||
- esy install | ||
script: | ||
- travis_wait 40 esy build | ||
- esy build | ||
cache: | ||
timeout: 360 | ||
directories: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### `esy` build status | ||
[](https://ci.appveyor.com/project/bryphe/esy-harfbuzz/branch/esy) | ||
[](https://travis-ci.org/bryphe/esy-harfbuzz) | ||
|
||
----------- | ||
|
||
[](https://travis-ci.org/harfbuzz/harfbuzz) | ||
[](https://ci.appveyor.com/project/harfbuzz/harfbuzz) | ||
[](https://circleci.com/gh/harfbuzz/harfbuzz) | ||
[](https://scan.coverity.com/projects/behdad-harfbuzz) | ||
[](https://app.codacy.com/app/behdad/harfbuzz) | ||
[](https://coveralls.io/r/harfbuzz/harfbuzz) | ||
[ABI Tracker](http://abi-laboratory.pro/tracker/timeline/harfbuzz/) | ||
|
||
This is HarfBuzz, a text shaping library. | ||
|
||
For bug reports, mailing list, and other information please visit: | ||
|
||
http://harfbuzz.org/ | ||
|
||
For license information, see the file COPYING. | ||
|
||
Documentation: https://harfbuzz.github.io |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cd _build | ||
|
||
# Automake gets brought in unnecessarily for the release package - | ||
# force dependencies to be 'up-to-date' to skip automake... | ||
touch aclocal.m4 | ||
touch Makefile.in | ||
touch configure | ||
touch config.h.in | ||
|
||
# OS_WIN32 invokes a python def file generator for MVSC linking, | ||
# which we don't need (it's implied by host - mingw) | ||
touch src/harfbuzz.def | ||
touch src/harfbuzz-subset.def | ||
touch src/harfbuzz-icu.def | ||
touch src/harfbuzz-gobject.def | ||
|
||
echo "**BUILD STARTED**" | ||
make | ||
echo "**BUILD COMPLETE**" | ||
make install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
./configure --prefix=E:/harfbuzz-prefix CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ AR=x86_64-w64-mingw32-ar | ||
cd _build | ||
./configure --prefix=$cur__install --host=x86_64-w64-mingw32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd _build | ||
./configure --prefix=$cur__install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cp -rp harfbuzz-1.9.0 _build | ||
|
||
cd _build | ||
|
||
# Create harfbuzz.def to skip generating python definitions | ||
touch src/harfbuzz.def |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* Based on: https://github.com/harfbuzz/harfbuzz-tutorial/blob/master/hello-harfbuzz-opentype.c */ | ||
|
||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
#include <hb.h> | ||
#include <hb-ot.h> | ||
|
||
#define FONT_SIZE 36 | ||
#define MARGIN (FONT_SIZE * .5) | ||
|
||
/* Use native open type implementation to load font | ||
https://github.com/harfbuzz/harfbuzz/issues/255 */ | ||
hb_font_t* | ||
get_font_ot(const char *filename, int size) | ||
{ | ||
FILE* file = fopen(filename, "rb"); | ||
fseek(file, 0, SEEK_END); | ||
unsigned int length = ftell(file); | ||
fseek(file, 0, SEEK_SET); | ||
|
||
char* data = malloc(length); | ||
fread(data, length, 1, file); | ||
fclose(file); | ||
|
||
hb_blob_t* blob = hb_blob_create(data, length, HB_MEMORY_MODE_WRITABLE, (void*)data, NULL); | ||
hb_face_t* face = hb_face_create(blob, 0); | ||
hb_font_t* font = hb_font_create(face); | ||
|
||
hb_ot_font_set_funcs(font); | ||
hb_font_set_scale(font, size, size); | ||
|
||
return font; | ||
} | ||
|
||
int | ||
main(int argc, char **argv) | ||
{ | ||
const char *fontfile; | ||
const char *text; | ||
|
||
if (argc < 3) | ||
{ | ||
fprintf (stderr, "usage: hello-harfbuzz font-file.ttf text\n"); | ||
exit (1); | ||
} | ||
|
||
fontfile = argv[1]; | ||
text = argv[2]; | ||
|
||
/* Create hb-ft font. */ | ||
hb_font_t *hb_font; | ||
hb_font = get_font_ot (fontfile, FONT_SIZE*64); | ||
|
||
/* Create hb-buffer and populate. */ | ||
hb_buffer_t *hb_buffer; | ||
hb_buffer = hb_buffer_create (); | ||
hb_buffer_add_utf8 (hb_buffer, text, -1, 0, -1); | ||
hb_buffer_guess_segment_properties (hb_buffer); | ||
|
||
/* Shape it! */ | ||
hb_shape (hb_font, hb_buffer, NULL, 0); | ||
|
||
/* Get glyph information and positions out of the buffer. */ | ||
unsigned int len = hb_buffer_get_length (hb_buffer); | ||
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (hb_buffer, NULL); | ||
hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (hb_buffer, NULL); | ||
|
||
/* Print them out as is. */ | ||
printf ("Raw buffer contents:\n"); | ||
for (unsigned int i = 0; i < len; i++) | ||
{ | ||
hb_codepoint_t gid = info[i].codepoint; | ||
unsigned int cluster = info[i].cluster; | ||
double x_advance = pos[i].x_advance / 64.; | ||
double y_advance = pos[i].y_advance / 64.; | ||
double x_offset = pos[i].x_offset / 64.; | ||
double y_offset = pos[i].y_offset / 64.; | ||
|
||
char glyphname[32]; | ||
hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); | ||
|
||
printf ("glyph='%s' cluster=%d advance=(%g,%g) offset=(%g,%g)\n", | ||
glyphname, cluster, x_advance, y_advance, x_offset, y_offset); | ||
} | ||
|
||
printf ("Converted to absolute positions:\n"); | ||
/* And converted to absolute positions. */ | ||
{ | ||
double current_x = 0; | ||
double current_y = 0; | ||
for (unsigned int i = 0; i < len; i++) | ||
{ | ||
hb_codepoint_t gid = info[i].codepoint; | ||
unsigned int cluster = info[i].cluster; | ||
double x_position = current_x + pos[i].x_offset / 64.; | ||
double y_position = current_y + pos[i].y_offset / 64.; | ||
|
||
|
||
char glyphname[32]; | ||
hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); | ||
|
||
printf ("glyph='%s' cluster=%d position=(%g,%g)\n", | ||
glyphname, cluster, x_position, y_position); | ||
|
||
current_x += pos[i].x_advance / 64.; | ||
current_y += pos[i].y_advance / 64.; | ||
} | ||
} | ||
|
||
hb_buffer_destroy (hb_buffer); | ||
hb_font_destroy (hb_font); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
echo TODO: Test! | ||
|
||
INCLUDE=$cur__install/include/harfbuzz | ||
|
||
ROOTDIR=$(pwd) | ||
|
||
if which x86_64-w64-mingw32-gcc; then | ||
CC=x86_64-w64-mingw32-gcc | ||
# Copy runtime mingw files | ||
BUILDDIR=$(pwd)/esy | ||
cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll $BUILDDIR/. | ||
else | ||
CC=gcc | ||
BUILDDIR=$(pwd)/_build | ||
fi | ||
|
||
echo "Using build directory: $BUILDDIR" | ||
echo "Root directory: $ROOTDIR" | ||
|
||
cd $BUILDDIR | ||
pwd | ||
|
||
echo "Using compiler: $CC" | ||
|
||
echo "Include Path: $INCLUDE" | ||
echo "Lib Path: $cur__lib" | ||
echo "Bin Path: $cur__bin" | ||
|
||
cp $cur__bin/*.dll . | ||
|
||
# Augment path to pick up libs | ||
export PATH=$PATH:$cur__bin:$cur__lib | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$cur__lib | ||
|
||
$CC $ROOTDIR/esy/test.c -o test.exe -std=c99 -I$INCLUDE -L$cur__lib -lharfbuzz | ||
./test.exe $ROOTDIR/esy/Roboto-Regular.ttf "test=>text" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
configure → harfbuzz-1.9.0/configure
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
Binary file renamed
BIN
+394 Bytes
docs/html/left-insensitive.png → ...buzz-1.9.0/docs/html/left-insensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file renamed
BIN
+372 Bytes
docs/html/right-insensitive.png → ...uzz-1.9.0/docs/html/right-insensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file renamed
BIN
+373 Bytes
docs/html/up-insensitive.png → harfbuzz-1.9.0/docs/html/up-insensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
install-sh → harfbuzz-1.9.0/install-sh
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.