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.
7 years ago
Ebrahim Byagowi
ce17340b23
Add hb_blob_create_from_file, a new API ( #926 )
7 years ago
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
7 years ago
David Corbett
8269791900
Allow trailing non-numeric chars in --unicodes
7 years ago
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
7 years ago
Ebrahim Byagowi
4f6f7c3b22
[util] Implement ppem/ptem on hb-{shape,view} ( #811 )
7 years ago
Rod Sheeter
74e0c13a4a
[subset] drop hint tables if so flagged. Still need to dump glyf instructions.
7 years ago
Rod Sheeter
0bd100e144
[subset] add --hinting flag
7 years ago
Behdad Esfahbod
d0f3e7f597
[util] Use setlinebuf() if present
...
To work around mysterious bug on OS X.
Fixes https://github.com/harfbuzz/harfbuzz/issues/727
7 years ago
Behdad Esfahbod
4c4a9fc861
Typo
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/711
7 years ago
Behdad Esfahbod
746a37d5bd
[util] Replace setlinebuf
7 years ago
Behdad Esfahbod
ff2083c53e
[util] Set stdio files to line buffering
...
So we can stream lines to hb-shape and read output.
7 years ago
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.
7 years ago
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.
7 years ago
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
7 years ago
Behdad Esfahbod
7b837e20d2
[util] Add TODO item
7 years ago
Behdad Esfahbod
bb7cc4eada
Minor
7 years ago
Behdad Esfahbod
dbdbfe3d7b
Use nullptr instead of NULL
7 years ago
Behdad Esfahbod
c3448e8d21
Use static_assert instead of custom ASSERT_STATIC
7 years ago
Behdad Esfahbod
9355218f58
[util] Add a few shorthand forms for commandline options
...
-o, -O, -u, -v, -V
7 years ago
Behdad Esfahbod
03a5a6f873
[util] Add --unicodes to hb-view / hb-shape
...
Fixes https://github.com/behdad/harfbuzz/issues/154
7 years ago
Behdad Esfahbod
a9e52a1af4
[util] Prefix trace lines with "trace:", and error lines with "error:"
7 years ago
Behdad Esfahbod
d2052278f2
[util] Add --verify to hb-shape / hb-view that verifies shape results
...
Right now it checks for monotone cluster values. Other checks to be added.
7 years ago
Behdad Esfahbod
40bd7e9a1c
[unsafe-to-break] Add UNSAFE_TO_BREAK flag
...
Not all shapers code is updated to set this properly.
GSUB and Arabic shaper are updated.
GPOS and other shapers are NOT.
Fixes https://github.com/behdad/harfbuzz/issues/224
7 years ago
Behdad Esfahbod
3e44748ebe
[util] Fix two other Coverity warnings
7 years ago
Behdad Esfahbod
6f38845d9c
[hb-shape] Rename --show-messages to --trace
...
https://github.com/behdad/harfbuzz/issues/506
7 years ago
Behdad Esfahbod
e60350551a
[hb-shape] Improve shaping-debug output
...
Before, that was printed using --debug (and in both hb-shape and hb-view).
Changed it, now hb-shape has a new command-line argument called --show-messages.
When invoked, it also respects other output formatting options. The messages
are better formatted and printed to te same place that hb-shape output is
directed to. Previously they were written to stderr.
Fixes https://github.com/behdad/harfbuzz/issues/506
7 years ago
Behdad Esfahbod
a429090572
[var] Flesh out --variations documentation
8 years ago
Behdad Esfahbod
111f3e5517
[util] Add --variations
...
Is hooked up to the font, but not to FreeType, so raster doesn't show yet.
Documentation needs to be done.
8 years ago
Behdad Esfahbod
21e5d7edc4
[util] Use O_BINARY instead of _O_BINARY
...
The latter doesn't seem to be available in Cygwin. I'm surprised it
compiled before...
9 years ago
Chun-wei Fan
998e8dda93
util: Fix build on Visual Studio
...
Use the fallback implementation for lround() only on pre-2013 Visual
Studio, and ensure we are clear about the types of the parameters for
lround() and scalbnf(), since Visual Studio can be quite picky on
ambiguous parameter types. Also, use g_ascii_strcasecmp() rather than
strcasecmp() as we are already using GLib for this code and we are
assured that g_ascii_strcasemp() is available.
For scalbnf() on pre-2013 Visaul Studio, a fallback implementation is
needed, but use another forced-included header for those compilers, which
will be added later.
Also use (char)27 on Visual Studio builds as '\e' is not a recognized
escape sequence, which will do the same thing.
9 years ago
Behdad Esfahbod
3530cc2d7c
[util] Fix option-parsing leaks
9 years ago
Behdad Esfahbod
642135f3b2
[util] In --debug mode, duplicate font data
...
This has the effect that the font data will end up in a memory
section malloc()ed exactly to its size. This gives us better
valgrind detection of out-of-bounds access.
Previously, the font data was placed in a mmap()ed section or
GString-allocated area, which didn't have proper protections
at the end when running under valgrind.
9 years ago
Behdad Esfahbod
fdd1770e00
Add API/cmdline to show glyph extents when serializing buffer
...
New API: HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS
hb-shape now accepts --show-extents.
Patch from Simon Cozens.
9 years ago
Behdad Esfahbod
376d587f36
Implement more granular cluster-merging
...
TODO: Documentation.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71445
9 years ago
Behdad Esfahbod
16dac7eccf
Fix build
10 years ago
Behdad Esfahbod
820505a186
Whitespace
10 years ago
Behdad Esfahbod
a664810e38
[util] Accept comma as well as space when separating components of args
...
Applies to --font-size and --margin.
Hopefully the scanf usage here doesn't have compatibility issues
(star being counted in the return value, etc).
10 years ago
Collin Fair
9ee176ee97
Stop hb-shape docs leaking into hb-view
10 years ago
Collin Fair
952b8dbdf6
'All' of the above, not 'each'
10 years ago
Collin Fair
9e867b6446
Remove reference to --help-output-content in --help-output (as --help-output-format's options aren't available in hb-view)
10 years ago
Collin Fair
1d55ffeb66
Add serialization syntax documentation. Clarify naming and wording in --help-output/--help-format
10 years ago
Behdad Esfahbod
cd4eb96abb
[util] Add --font-size to hb-shape
...
Also makes hb-view to use 8 bits of subpixel precision and shape at
requested size, instead of always shaping at upem and scaling results.
10 years ago
Behdad Esfahbod
5789ca69d7
[util] Minor
10 years ago
Behdad Esfahbod
c36c4a9924
Add missing va_end()
...
Fixes https://github.com/behdad/harfbuzz/pull/74
10 years ago
Behdad Esfahbod
0de25d4184
[util] Note CSS compatibility in --help-features
10 years ago
Behdad Esfahbod
8650def735
[util] Add option to set font function implementation to use
...
Supports ft and ot right now. hb-view currently not rendering with ot.
Will fix after some clean up.
11 years ago
Behdad Esfahbod
2306ad46dc
[util] Fix memory issue
11 years ago
Behdad Esfahbod
903648437c
Start fleshing out builtin font functions
11 years ago
Behdad Esfahbod
ea5e8a02eb
[util] Plug minor leak
11 years ago