Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] OpenType Support #20

Merged
merged 49 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2142c48
Added libunibreak submodule
shermp Oct 23, 2018
f88d27a
Basic not-yet-working opentype implementation
shermp Oct 26, 2018
af8e592
Switched line calcs to using GetCodepointBitmapBox
shermp Oct 26, 2018
c81fa6e
Turns out 'out_stride' is a rather important parameter...
shermp Oct 26, 2018
bf35814
Forgot to reset x coordinate at the end of a line
shermp Oct 26, 2018
27c428d
A little cleanuo
shermp Oct 26, 2018
793fb14
Add a couple of comments
shermp Oct 26, 2018
d10afea
That ifndef is a) not needed, and b) incorrect. It's got to go
shermp Oct 26, 2018
982f17b
Changed "not supported" errorcode to ENOSYS
shermp Oct 26, 2018
5bf6d48
Documented OpenType API
shermp Oct 26, 2018
0cc34dc
Added default font size handling
shermp Oct 26, 2018
f9b0f13
Added guard against calling fb_print_ot() before fb_init_ot()
shermp Oct 26, 2018
db8da51
Hard linebreaks no longer broken
shermp Oct 26, 2018
72b5479
Revert debug CFLAGS
shermp Oct 26, 2018
48f5aa1
Updated credits with stb_truetype and libunibreak info
shermp Oct 26, 2018
d212790
Remove that invert macro, replacing with an xor instead.
shermp Oct 26, 2018
84dd6bf
Handled region rotation
shermp Oct 26, 2018
f055fbe
Changed Font loading. Skeleton support for multiple variants
shermp Oct 27, 2018
f2d4e51
Mostly working font variant and formatted text support
shermp Oct 27, 2018
d6d5bc9
Fix the makefile for debug builds too
shermp Oct 27, 2018
c8fa18a
Lets pretend I initialised that variable before eh?
shermp Oct 27, 2018
ac9dcd0
Review pass
shermp Oct 27, 2018
64b7bd2
Fixed a couple of potential issues
shermp Oct 27, 2018
9475a16
Applied patch from NiLuJe
shermp Oct 27, 2018
4320d6c
Properly handle case when we don't want text formatted
shermp Oct 28, 2018
14c0c9c
Hopefully fix a potential cause of segfaults
shermp Oct 28, 2018
ddb6a03
gcc review pass
shermp Oct 28, 2018
747d984
Cleanup, and error messages added
shermp Oct 28, 2018
7433dda
Minor cleanup, more error handling, informational messages
shermp Oct 28, 2018
5383531
Changed number of rows calculation
shermp Oct 28, 2018
a25a2ca
Space char changes. Further attempts to reconcile measure & rendering
shermp Oct 28, 2018
6594fae
Fixed trailing spaces on linebreaks
shermp Oct 28, 2018
562d5b7
Implemented fixes from NiLuJe, and underflow fix
shermp Oct 28, 2018
263c2c8
Minor tweaks (and push test ;p)
NiLuJe Oct 28, 2018
a70c35c
Hopefully fixed segfault with misbehaving fonts (new measring routine)
shermp Oct 29, 2018
1481011
Review pass
shermp Oct 29, 2018
9872268
Measure total height to print, to support vertical alignment
shermp Oct 30, 2018
eccb5a3
Added FBInkConfig as an optional parameter, and added alignment options
shermp Oct 30, 2018
1bcffb3
Updated fbink API for new OT options
shermp Oct 30, 2018
39b67cf
Implemented bg/fg colour support
shermp Oct 30, 2018
6c64012
Implemented is_fgless
shermp Oct 30, 2018
523f35d
Implemented is_overlay
shermp Oct 30, 2018
2db778e
Review pass
shermp Oct 30, 2018
1052542
Changed margin handling to pixels from %. Added new print return values
shermp Oct 30, 2018
5dcec3a
Made glyph buffer handling safer
shermp Oct 30, 2018
0f77899
Forgot to update the glyph buffer size after resizing
shermp Oct 30, 2018
cd27a12
Made glyph buffer realloc safer with temp pointer
shermp Oct 30, 2018
de191bb
Change eink refresh handling. Implement is_cleared and is_flashing
shermp Oct 30, 2018
1b294aa
Um... that was supposed to be a pointer
shermp Oct 30, 2018
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: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "stb"]
path = stb
url = https://github.com/nothings/stb.git
[submodule "libunibreak"]
path = libunibreak
url = https://github.com/adah1972/libunibreak
5 changes: 4 additions & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ This project makes use of a number of third-party libraries, which we'll acknowl
Released into the public domain.
(https://www.cprogramming.com/tutorial/unicode.html)

* stb_image (Image loader), by Sean Barrett,
* stb_image (Image loader) and stb_truetype (font renderer), by Sean Barrett,
Released into the public domain.
(http:https://nothings.org/stb)

* libunibreak (Unicode line breaking implementation) by Wu Yongwei, et al
Licensed under the Zlib license
(https://github.com/adah1972/libunibreak)

As well as a number of third-party resources (namely, font files):

Expand Down
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,16 @@ ifdef MATHS
EXTRA_CPPFLAGS+=-DFBINK_WITH_MATHS
LIBS+=-lm
endif

ifndef MINIMAL
LIBS+=-lm
endif
##
# Now that we're done fiddling with flags, let's build stuff!
LIB_SRCS=fbink.c utf8/utf8.c
ifdef MINIMAL
LIB_SRCS=fbink.c utf8/utf8.c
else
LIB_SRCS=fbink.c utf8/utf8.c libunibreak/src/linebreak.c libunibreak/src/linebreakdata.c libunibreak/src/unibreakdef.c libunibreak/src/linebreakdef.c
endif
CMD_SRCS=fbink_cmd.c
BTN_SRCS=button_scan_cmd.c
# Unless we're asking for a minimal build, include the Unscii fonts, too
Expand All @@ -191,6 +197,7 @@ ifdef MINIMAL
else
EXTRA_CPPFLAGS+=-DFBINK_WITH_FONTS
EXTRA_CPPFLAGS+=-DFBINK_WITH_IMAGE
EXTRA_CPPFLAGS+=-DFBINK_WITH_OPENTYPE
# Connect button scanning is Kobo specific
ifndef KINDLE
ifndef CERVANTES
Expand Down Expand Up @@ -235,7 +242,7 @@ $(OUT_DIR)/%.o: %.c
$(CC) $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(SHARED_CFLAGS) -o $@ -c $<

outdir:
mkdir -p $(OUT_DIR)/shared/utf8 $(OUT_DIR)/static/utf8
mkdir -p $(OUT_DIR)/shared/utf8 $(OUT_DIR)/static/utf8 $(OUT_DIR)/shared/libunibreak/src $(OUT_DIR)/static/libunibreak/src

all: outdir static

Expand Down Expand Up @@ -348,17 +355,21 @@ clean:
rm -rf Release/*.so*
rm -rf Release/shared/*.o
rm -rf Release/shared/utf8/*.o
rm -rf Release/shared/libunibreak/src/*.o
rm -rf Release/static/*.o
rm -rf Release/static/utf8/*.o
rm -rf Release/static/libunibreak/src/*.o
rm -rf Release/*.o
rm -rf Release/fbink
rm -rf Release/button_scan
rm -rf Debug/*.a
rm -rf Debug/*.so*
rm -rf Debug/shared/*.o
rm -rf Debug/shared/utf8/*.o
rm -rf Debug/shared/libunibreak/src/*.o
rm -rf Debug/static/*.o
rm -rf Debug/static/utf8/*.o
rm -rf Debug/static/libunibreak/src/*.o
rm -rf Debug/*.o
rm -rf Debug/fbink
rm -rf Debug/button_scan
Expand Down
Loading