| [ Return to Bugs & Features | SVN ⇄ GIT ]
STR #3309
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 2 - Specific to an operating system |
Subsystem: | X11 |
Summary: | Use pango to draw UTF-8 text under X11+Xft |
Version: | 1.4-feature |
Created By: | manolo |
Assigned To: | manolo |
Fix Version: | 1.4-current (SVN: v12153) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | manolo 23:06 May 30, 2016 |
| I'd like to propose to add the possibility to use the pango library when drawing text for the X11+Xft platform.
The benefit is that any font can be used to draw any text (latin, greek, chinese, arabic,...). Apparently, drawing is very fast.
The attached patch has been tested under Debian, FreeBSD and Darwin. It is intended as a new option of the porting branch.
For now, only the CMake build system is usable with : cmake -D OPTION_PANGO=true path-to-source | |
|
#2 | manolo 23:56 Jun 03, 2016 |
| Attached pango2.patch adds some optimization and fixes drawing of newline-containing strings. | |
|
#3 | manolo 08:55 Jun 05, 2016 |
| To build under Unbuntu, 2 more changes are required, besides pango2.patch :
1) add these 2 more directories to the dir list at line 358 of file CMake/options.cmake :
/usr/lib/i386-linux-gnu/glib-2.0/include /usr/lib/x86_64-linux-gnu/glib-2.0/include
2) in file src/drivers/xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx, line 1206, use const void * instead of void * | |
|
#4 | manolo 23:05 Jun 05, 2016 |
| Attached file pango3.patch includes all changes for building under Ubuntu with cmake -D OPTION_PANGO=true path-to-source and works also without OPTION_PANGO | |
|
#5 | manolo 23:28 Jun 10, 2016 |
| Attached file pango5.patch supports CMake-based building under Debian, Ubuntu, FreeBSD, NetBSD and Darwin.
Also, file src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx has been slightly modified and committed to svn (no Pango support in svn repository yet).
With that, the patch can be applied either with patch -p0 < pango5.patch or svn patch pango5.patch (Thanks to Albrecht who discovered why patch did not work before) | |
|
#6 | manolo 07:46 Jun 14, 2016 |
| Attached file configure.patch gives pango support for configure-based build (porting branch always).
It's necessary to apply both pango5.patch and configure.patch. It's expected to work for Debian, Ubuntu, Darwin, FreeBSD, NetBSD.
Recipe:
./autogen.sh
./configure --enable-pango
make
Under FreeBSD and NetBSD, it's necessary to use gmake instead of make because the construct CPPFILES += $(shell if test $(BUILD_X11) = Yes; then echo $(XLIBCPPFILES); fi) does not work (that is STR#3315).
Advise from configure expert for how to improve the patch is much welcome. | |
|
#7 | michaelbaeuerle 10:01 Jun 14, 2016 |
| Looks like the glyph composition with pango fails in some cases:
For U+0331 'COMBINING MACRON BELOW' it works. Example:
a̱ e̱
But for U+0332 'COMBINING LOW LINE' it fails. Example:
a̲ e̲ | |
|
#8 | manolo 07:41 Dec 11, 2016 |
| Attached 'word_limit.patch' alows double-click word selection with non-ASCII, left-to-right text.
Note: text selection remains seriously broken with right-to-left scripts. | |
|
#9 | AlbrechtS 13:58 Dec 11, 2016 |
| Some comments or suggestions:
pango6.patch:
First I thought OPTION_PANGO should be called OPTION_USE_PANGO for consistency, but then we also have OPTION_CAIRO and some more, so I'm not sure what to suggest.
However, all variables named HAS_* should definitely be renamed to HAVE_*:
- HAS_LIB_GOBJECT - HAS_LIB_PANGO - HAS_LIB_PANGOXFT - HAS_PANGO_H - HAS_PANGOXFT_H
The point is e.g. selection/groups (search) in cmake-gui. All existing (user defined) variables are called HAVE_*.
word_limit.patch:
+ if (C == 0xA0) return true; // NO-BREAK SPACE
My gut feeling is that NO-BREAK SPACE should NOT be considered a word delimiter, but ... who knows?
Other than that: great, thanks! | |
|
#10 | manolo 07:11 Dec 21, 2016 |
| Pango support for the X11 platform has been committed at r.12153. It is turned OFF by default. Turning it ON requires the OPTION_USE_PANGO CMake option, or the --enable-pango option for configure-based builds. Word-selection by double-click seems OK also. Text selection with right-to-left text is miserable. | |
|
#11 | manolo 07:13 Dec 21, 2016 |
| Will close w/resolution if no major problem is discovered. | |
|
#12 | AlbrechtS 11:56 Mar 05, 2017 |
| Shouldn't we close this STR now? | |
|
#13 | manolo 01:27 Mar 06, 2017 |
| Fixed in Subversion repository. | |
[ Return to Bugs & Features ]
|
| |