xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XForms] pre-relase xforms-1.3.12


From: oleuthold
Subject: [XForms] pre-relase xforms-1.3.12
Date: Thu, 26 Jun 2014 21:18:15 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

The file xforms-1.3.12.tar.gz with datestamp 25-Jun-2014 19:21 does not compile due to issues with pthumbwheel.h : thumbwheel.c:41:33: fatal error: private/pthumbwheel.h: No such file or directory I have not found a simple way to get rid of the error; thus I leave it up to you to upload a version which has this error fixed.
Regards
      Oskar

On 06/26/2014 09:00 AM, address@hidden wrote:
Send xforms-development mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.nongnu.org/mailman/listinfo/xforms-development
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of xforms-development digest..."


Today's Topics:

    1. True Type font pre-release (Jens Thoms Toerring)


----------------------------------------------------------------------

Message: 1
Date: Wed, 25 Jun 2014 22:33:38 +0200
From: Jens Thoms Toerring <address@hidden>
To: address@hidden
Subject: [XForms] True Type font pre-release
Message-ID: <address@hidden>
Content-Type: text/plain; charset=us-ascii

Hi,

   here's a new pre-release that includes support for TTF/OTF fonts
via the use of the Xft library:

http://download-mirror.savannah.gnu.org/releases/xforms/development/1.3/xforms-1.3.12.tar.gz

Actually, it's now two different versions of the XForms library:
when you run './configure' as you used to the new version with su-
pport for TTF/OTF fonts will be build. If you pass the '--disable-xft'
option to 'configure' a version is build that uses only the old X11
bitnap fonts (and thus should work as the previous versions).

In both versions the resulting library isn't backward compatible to
older versions (since some internal data structures had to be modi
fied), giving it a new major SO-version of 3. Thus all of your pro-
grams not rebuild will still use the already installed old version
of the library. Since this is a new SO-version you may have to
run the 'ldconfig' command after installation to make the dynamic
linker aware of its existence (a typical sign that this is required
is when you try to start fdesign and all you get is an error mes-
sage about libforms.so.3 not having been found).

With the new version there's also an updated format of the fdesign
files, so it probably will be useful to keep backups of your .fd
files around if you want to test fdesign on them.

Let's come to the actual differences and start with fdesign. You
may notice that in the "Options" meny in the main window there's
a new entry: "Use X11 fonts". This allows you to switch back and
forward between the use of the mnew TTF/OTF fonts and the old X11
bitmap fonts (as close as I was able to get it). This will also
switch between the fonts fdesign itself uses. If this option is on
when you safe a file the .fd file will contain a flag that will
make fdesign switch to the X11 fonts automatically when that .fd
file is loaded. It also will add a line to the main() function in
the C output file directly after the line with 'fl_initialize()'
to make your program switch to the use of X11 fonts. Thus, if you
find that your program doesn't look well with the new fonts you
can go back to the old ones (and then still use features like
anti-aliasing and arbitrary scaling!).

The function for switching between the default fonts used is

fl_set_default_font_type(int type);

where 'type' is either 'FL_XFT_FONT' or 'FL_X11_FONT'. The function
can also be used to "re-initialize" the settings for the default
fonts - if you have changed them and want to get back to the initial
state simply call this function.

If you like the new fonts but have an issue with their sizes you
also can set a global scaling factor for all fonts using

void fl_set_global_font_scaling(double scale);

to reduce or increase the size of all fonts at once.

If the problem is only for a certain font use instead

void fl_set_font_scaling_factor(int    index,
                                 double factor);

Here 'index' is the font number (the default fonts have, as before,
the numbers 0 to 15 while the indices for additonally loaded fonts
is set by yourself.

The already existing function

int fl_set_font_name(int index, const char * name);

for loading additional fonts can only be used for X11 fonts and
with the traditional XLFD (X Logical Font Descrition) names.

If you want to load a TTF/OTF file you instead have to use

int fl_set_xft_font_name(int index, const char * name,
                          int slant, int weight);

For the name you now will use more easy to remember names like
"DejaVu Sans" or "Comic Sans MS". The slant myst be one of
'FL_SLANT_ROMAN', 'FL_SLANT_ITALIC' or 'FL_SLANT_OBLIQUE'
and for 'weight you can use 'FL_WEIGHT_LIGHT', 'FL_WEIGHT_MEDIUM',
'FL_WEIGHT_DEMIBOLD', 'FL_WEIGHT_BOLD' or 'FL_WEIGHT_BLACK'.
Of course, you should check with the 'fc-list' tool which fonts
are really available on your system;-) If you specify a font that
doesn't exist a replacement font will be picked automatoically by
the Xft library.

Note that the upper limit on the number of fonts that can be used
at once has been raised to about 1000. You can pick an arbitrary
valkue between 16 and 1000 for the index (the upper limit is actually
'FL_SHADOW_STYLE - 1'). And each of these fonts is available in any
size not less than 1.

Of course these functions can also, as previously, be used to replace
the default fonts.

Fonts can now also be unloaded when not needed anymore, use

int fl_unload_font(int index);

to unload a font given its index (this doesn't work for the default
fonts with indices 0 to 15).

If you just want to dealocate a font at a certain point size use

int fl_unload_sized_font(int index, int size);

Concerning the default fonts: as a first attempt DejaVu Sans,
DejaVu Mono and DejaVu Serif are used and a Palladino-clone,
FPL Neu. If these fonts are suitable is, of course, something
we should discuss - changing this is trivial.

Since I can't be sure these fonts are available everywhere I've
included them into the package (even though this increases its
size by more than a factor of 2).

The fonts will be installed in '/usr/local/share/fonts/XForms'
(unless you have changed the 'prefix' during 'configure') and
the fontconfigure cache will automatically be rebuild. This is
probably not the most elegant way and may change in the future,
but that was the best I could come up with at the moment.

If you ever have used the directory listing functions build into
XForms, i.e., fl_get_dirlist(), and checked if a returned entry
is of a normal file you've probably been using the 'FT_FILE'
macro. Unfortunately, this macro is already in use by the free-
type library (and its header files get automatically included
by the headers of the Xft linrary). So I had to change it to
'FT_REG' (for "regular" file). This is a bit unfortunate since
the compiler won't flag any proplems if you code uses 'FT_FILE'
since the macro is still defined, but to a different thing. Thus
you should grep your sources for use of it and replace each occu-
rence with 'FT_REG'.

What else? When you compile your programs with the new library
you need an additional compile time option,

$(pkg-config --cflags freetype2)

This is because the Xft.h file now must be included in forns.h
and this, in turn includes the freetype header files. But there
are two incompatible versions of these headers and the Xft header
can't decide on its own which one is to be used. That's what that
bit is good for, it resolves typically to '-I/usr/include/freetype2',
i.e., the correct include path for the required freetype headers.
A bit of a mess, admittedly, but there's nothing I can do about
that...

There are a few more new things, but this email is already much too
long, so I stop here and tell you about that later. For the time
being I guess there's already enough to test;-) So, please, give it
a try and report all the problems you'll find. I'm well aware that
this is not a production-ready release yet and a few things will
change for sure. Any help in finding the weak points will be appre-
ciated!
                                Best regards, Jens

PS: If you are done with testing and want to go back to the old
     version go into the directory of the new version, run "make
     uninstall", and then go into the directory of the old version
     you want to go back to and run there "make install" again.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]