ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Bug: Reloading Font
Date: Sun, 13 Oct 2013 13:48:57 +0200	[thread overview]
Message-ID: <CAG5iGsCPkFwhwYo6niGqsB5kJoXBY+MKtLK+_pX03WHWNqg7nQ@mail.gmail.com> (raw)
In-Reply-To: <20131013081515.GA11915@khaled-laptop>


[-- Attachment #1.1: Type: text/plain, Size: 3524 bytes --]

On Sun, Oct 13, 2013 at 10:15 AM, Khaled Hosny <khaledhosny@eglug.org>wrote:

> An external module is fine by me, I’m not concerned about LuaTeX itself
> since even the current loader is not integrated, I’m rather concerned
> about the ability to use the new loader and shaper with ConTeXt.
>

A minimal luatex wrapper for harfbuzz for Linux x86_64 is quite straight



Build configuration:

Unicode callbacks (you want at least one):
    Glib:            true
    ICU:            false
    UCDN:            false

Font callbacks (the more the better):
    FreeType:        true

Tools used for command-line utilities:
    Cairo:            true

Additional shapers (the more the better):
    Graphite2:        false

Platform shapers (not normally needed):
    CoreText:        false
    Uniscribe:        false

Other features:
    Documentation:        false
    GObject bindings:    false
    Introspection:        false


core.i
%module core
%{
#include "harfbuzz/hb-ot.h"
#include "harfbuzz/hb-ft.h"
#include "harfbuzz/hb-glib.h"
#include <ft2build.h>
#include FT_FREETYPE_H
%}
%include "harfbuzz/hb-common.h"
%include "harfbuzz/hb-blob.h"
%include "harfbuzz/hb-buffer.h"
%include "harfbuzz/hb-deprecated.h"
%include "harfbuzz/hb-face.h"
%include "harfbuzz/hb-font.h"
%include "harfbuzz/hb-set.h"
%include "harfbuzz/hb-shape.h"
%include "harfbuzz/hb-shape-plan.h"
%include "harfbuzz/hb-unicode.h"
%include "harfbuzz/hb-version.h"
%include "harfbuzz/hb.h";
%include "harfbuzz/hb-ft.h";
%include "harfbuzz/hb-glib.h";
%include "harfbuzz/hb-ot.h";
%include "harfbuzz/hb-ot-layout.h";
%include "harfbuzz/hb-ot-tag.h";
%include "harfbuzz/hb-shape.h";

##
## build-gcc.sh
##
. ./vars.sh
swig  -cpperraswarn  -c++  -lua core.i

rm -vf core_wrap.o
g++   -O2 -fPIC -I./harfbuzz -I/usr/include/freetype2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$LUAINC52 -c core_wrap.cxx
-o core_wrap.o

rm -vf core.so
g++ -Wall -shared -O2 -Wl,-rpath,'$ORIGIN/.' $CFLAGS \
    core_wrap.o  \
    -llua5.2  $LIBS \
    -o core.so


##
##t vars.sh
##
SWIGPATH=/home/luigisvn/projects/swiglib/swig-2.0.9/linux_x86_64
LUAINC52=/usr/include/lua5.2

CFLAGS="-I./harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g
-O2 -Wall -L./swiglib/harfbuzz"
LIBS="-lharfbuzz"
export PATH=$SWIGPATH/bin:$LLVMPATH/bin:${PATH}


--
-- test.lua
--
local f,error=package.loadlib("./swiglib/harfbuzz/core.so","luaopen_core");
if not(f) then print(error) return end;
local helpers=f(); for k,v in pairs(helpers) do print(k,v) end

$>luatex test.lua

An idea for freetype is
https://github.com/luigiScarso/ftlua

As Hams wrote
""
In principle one can plug in anything if it behaves nicely, but of course
one cannot expect existing mechanisms (we have additional features and
such) to be dropped in favor of something else without pretty good reason.
Btw, for me (that is personal) i think that it's not bad to have an
alternative shaper like we have in context if only because a standard (like
opentype) is no standard if there is only one (to be used) implementation.
""
It's also  important to have a shaper that behaves in the same way in
windows/linux/mac without depends on too many external libs
-- at the ctx meeting in brejlov 2010   there was a talk by a dutch company
about this.

--
luigi

[-- Attachment #1.2: Type: text/html, Size: 4935 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2013-10-13 11:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  3:35 Thangalin
2013-10-11  6:55 ` luigi scarso
2013-10-11  7:59   ` Hans Hagen
2013-10-11  8:59 ` luigi scarso
2013-10-11 11:55   ` luigi scarso
2013-10-11 12:02     ` Taco Hoekwater
2013-10-11 15:19       ` Thangalin
2013-10-11 21:16       ` Hans Hagen
2013-10-11 21:39         ` Thangalin
2013-10-11 22:26           ` Philipp Gesang
2013-10-11 22:48             ` Thangalin
2013-10-12  0:02               ` Hans Hagen
2013-10-12  0:15                 ` Philipp Gesang
2013-10-12  0:19                   ` Hans Hagen
2013-10-12  7:27                     ` Khaled Hosny
2013-10-12  9:18                       ` Hans Hagen
2013-10-12 10:19                         ` Khaled Hosny
2013-10-12 22:39                           ` Hans Hagen
2013-10-13  8:15                             ` Khaled Hosny
2013-10-13  9:49                               ` Hans Hagen
2013-10-13 11:48                               ` luigi scarso [this message]
2013-10-11 23:53             ` Hans Hagen
2013-10-12  3:05               ` Thangalin
2013-10-12  8:52                 ` Khaled Hosny
2013-10-12  9:20                   ` Hans Hagen
2013-10-12  9:29                     ` luigi scarso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG5iGsCPkFwhwYo6niGqsB5kJoXBY+MKtLK+_pX03WHWNqg7nQ@mail.gmail.com \
    --to=luigi.scarso@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).