Commit Graph

233 Commits

Author SHA1 Message Date
Ebrahim Byagowi 159ddb8729
Treat - just as /dev/stdin and remove one extra file reader (#1065) 2018-06-24 23:09:16 +04:30
Ebrahim Byagowi d0c2889dfc
Revert file blob sanitization and index checking (#1062)
As https://github.com/harfbuzz/harfbuzz/pull/1059#issuecomment-397912812 we
like to still work with blobs that harfbuzz itself can't handle directly that are failing sanitization
currently apparently.
2018-06-18 19:59:33 +04:30
Ebrahim Byagowi c53697d3f2
Verbose fail when something is wrong with hb-shape/hb-view input font file (#1059)
This checks if the blob isn't empty and uses `hb_face_count`
to see if the font file passes the simple font file sanitization
so can detect if the input is actually a font and checks also
whether input font-index is out of range.
2018-06-17 17:04:55 +04:30
Ebrahim Byagowi aa0c5df419
Fix reading fonts from stdin (#1060)
We were passing the font path directly to freetype so rendering
was broken when we are getting the font from stdin.

This fixes it by using FT_New_Memory_Face instead.

This fixes:
* build/util/hb-view /dev/stdin text < font.ttf
* build/util/hb-view - text < font.ttf
* cat font.ttf | build/util/hb-view - text

but doesn't work on
* cat font.ttf | build/util/hb-view /dev/stdin text

which I will try to fix separately.
2018-06-17 16:49:34 +04:30
Ebrahim Byagowi eaf649450a Resolve clang's conditional-uninitialize warnings 2018-04-23 11:38:45 -07:00
Ebrahim Byagowi ce17340b23 Add hb_blob_create_from_file, a new API (#926) 2018-04-20 07:59:06 +02:00
Khaled Hosny 6fdeeb2ae3 [util] Check all specified shapers are known (#993)
A bit brute force and requires all shapers to be known, not just one.

Fixes https://github.com/harfbuzz/harfbuzz/issues/956
2018-04-19 22:41:37 +02:00
David Corbett 8269791900 Allow trailing non-numeric chars in --unicodes 2018-03-26 01:36:37 -07:00
Behdad Esfahbod 127096e474 [util] Remove line buffering
Something weird seems to be going on. Just kill it.

Fixes https://github.com/harfbuzz/harfbuzz/issues/888
2018-03-15 13:23:27 -07:00
rsheeter 4a1d51ef15
Merge pull request #818 from googlefonts/drophints
[subset] Drop hints
2018-02-26 20:23:41 -08:00
Ebrahim Byagowi bb82f01383 [aat] trak sanitization 2018-02-26 00:15:26 -08:00
Rod Sheeter d78393b554 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz into drophints 2018-02-23 17:53:26 -08:00
Ebrahim Byagowi 4f6f7c3b22
[util] Implement ppem/ptem on hb-{shape,view} (#811) 2018-02-23 02:54:12 +03:30
Rod Sheeter 74e0c13a4a [subset] drop hint tables if so flagged. Still need to dump glyf instructions. 2018-02-21 11:19:18 -08:00
Rod Sheeter 0bd100e144 [subset] add --hinting flag 2018-02-21 10:34:00 -08:00
Behdad Esfahbod 9046e92442 [subset] Rename constructor to hb_subset_input_create_or_fail()
To signify that unlike rest of library, returns nullptr on failure.
2018-02-13 22:07:12 -08:00
Behdad Esfahbod d5b33f2fe1 [subset] hb_subset_input_t changes 2018-02-13 13:55:10 -08:00
Behdad Esfahbod 70b06cc6e7 More fixes 2018-02-10 16:13:06 -06:00
Behdad Esfahbod 4011d885b7 [util] Remove use of ssize_t which was failing on MSVC 2018-02-10 14:09:06 -06:00
Behdad Esfahbod 570d523761 [subset] Merge remote-tracking branch 'googlefonts/master' 2018-02-10 13:24:22 -06:00
Behdad Esfahbod d0f3e7f597 [util] Use setlinebuf() if present
To work around mysterious bug on OS X.

Fixes https://github.com/harfbuzz/harfbuzz/issues/727
2018-02-10 12:46:11 -06:00
Rod Sheeter 8431c38cdc remove output noise 2018-02-08 19:20:58 -08:00
Behdad Esfahbod 194140d3f3 [util] Minor 2018-02-08 16:27:57 -06:00
Behdad Esfahbod af02812fc5 [subset] Change hb_subset API to remove hb_subset_face_t 2018-02-07 13:07:46 -05:00
Rod Sheeter 6c52d94fd1 capture the set of codepoints passed by --unicodes 2018-02-07 12:41:21 -05:00
Garret Rieger 7481f0ce21 Add codepoints to subset input. 2018-02-07 12:41:21 -05:00
Ebrahim Byagowi 70e13ade81
[subset] Fix Windows issue on endlines (#756) 2018-02-06 13:20:38 +03:30
Garret Rieger 2ea228935d ssize_t -> size_t 2018-02-05 15:10:01 -08:00
Garret Rieger c25898eb54 Switch to fopen() instead of open() in subset test. open wasn't compiling on windows. 2018-02-05 14:35:32 -08:00
Garret Rieger fc04f11ce1 Rename HB_SUBSET_sources -> HB_SUBSET_CLI_sources to match what cmake is looking for. 2018-02-05 11:12:33 -08:00
Garret Rieger e428f7b1c2 Wrap unistd.h include in ifdef. 2018-02-05 10:24:16 -08:00
Behdad Esfahbod ae39fc8171 [subset] Build hb-subset into separate libharfbuzz-subset.so 2018-02-04 20:18:52 -05:00
Behdad Esfahbod eac20e4595 [subset] Minor 2018-02-04 20:08:50 -05:00
Rod Sheeter edcd3b80e9 Actually call hb_subset 2018-02-04 12:57:34 -08:00
Garret Rieger f83a43b561 Add CMake configuration for all of the new subsetting code. 2018-02-04 12:57:34 -08:00
Garret Rieger 5bc0cda179 Add missing unistd header to hb-subset. 2018-02-04 12:57:34 -08:00
Garret Rieger 058b1260ad Re-write hb-subset utility to use main-font-text driver. 2018-02-04 12:57:34 -08:00
Garret Rieger ede84ffa42 Whitespace 2018-02-04 12:57:34 -08:00
Rod Sheeter e9d154ac8d tweak test failure output. write to a temp file not stdout. test still fails because expected is not just an identical copy of input 2018-02-04 12:57:33 -08:00
Rod Sheeter 9ccb8366f6 Start to sketch APIs for subsetting 2018-02-04 12:57:33 -08:00
Behdad Esfahbod 4c4a9fc861 Typo
Fixes https://github.com/harfbuzz/harfbuzz/issues/711
2018-01-17 09:48:08 -08:00
Behdad Esfahbod 7c32e01d04 Minor 2018-01-11 10:47:31 +01:00
Behdad Esfahbod 746a37d5bd [util] Replace setlinebuf 2018-01-10 16:47:47 +01:00
Behdad Esfahbod ff2083c53e [util] Set stdio files to line buffering
So we can stream lines to hb-shape and read output.
2018-01-10 13:58:41 +01:00
Behdad Esfahbod 3b1e97f364 Add HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
New API:
HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
hb-shape / hb-view --remove-default-ignorables

One more text-rendering-tests test passing.  Eleven failing.
2018-01-10 03:36:03 +01:00
Behdad Esfahbod 3f29ea9144 [util] Add hb-shape --ned
For not displaying extra data: no clusters, no advance. Just data pertaining
to where glyphs end up on the screen.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 71fd6325b6 Add option to buffer serialization to not output glyph advances
When advances are not printed, glyph offsets reflect absolute glyph
positions.

New API:
HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES
hb-shape --no-advances
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 7b837e20d2 [util] Add TODO item 2018-01-03 12:46:29 +00:00
Olivier Blin 0fd89dc61c [hb-ft] Fix build when Multiple Master font support is disabled in freetype
FT_Set_Var_Blend_Coordinates() is not available when "Multiple Master
font interface" is disabled in freetype's modules.cfg
2017-12-04 10:52:06 -08:00
Behdad Esfahbod bb7cc4eada Minor 2017-11-20 19:39:47 -08:00