unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How is a composition being done?
@ 2010-08-09 18:29 Yair F
  2010-08-10  1:13 ` Kenichi Handa
  0 siblings, 1 reply; 6+ messages in thread
From: Yair F @ 2010-08-09 18:29 UTC (permalink / raw)
  To: emacs-devel

Hello,

Trying to figure how to write composition expressions.

Is the composition done forwards, that is when encountering a
base character further marks are searched forward to check if
they can be composed? Or is the composition is done backwards,
that is when a composable mark is encountered Emacs searches
backwards to find a base character it can compose to?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How is a composition being done?
  2010-08-09 18:29 How is a composition being done? Yair F
@ 2010-08-10  1:13 ` Kenichi Handa
  2010-08-10 11:52   ` James Cloos
  0 siblings, 1 reply; 6+ messages in thread
From: Kenichi Handa @ 2010-08-10  1:13 UTC (permalink / raw)
  To: Yair F; +Cc: emacs-devel

In article <AANLkTimpeNRRJkaZdkCj3ryvFKQQ3DCW9vVszs27YKQ=@mail.gmail.com>, Yair F <yair.f.lists@gmail.com> writes:

> Trying to figure how to write composition expressions.

> Is the composition done forwards, that is when encountering a
> base character further marks are searched forward to check if
> they can be composed? Or is the composition is done backwards,
> that is when a composable mark is encountered Emacs searches
> backwards to find a base character it can compose to?

It's done both forward and backward in some sence.

When you do:

  (aset composition-function-table CH
        ([PATTERN1 2 FUNC1] [PATTERN2 0 FUNC2]))

Emacs searches for CH, and if it is found at position POS,
it checks if the buffer contents at (POS - 2) and after
matches with PATTERN1.  If matched, the matched part is
composed by FUNC.  If not, Emacs checks the buffer contents
at (POS - 0) and after matches with PATTERN2.  If matched,
the matched part is composed by FUNC2.

So, on setting composition-function-table, you must consider
two things; which character sequence must be composed
(i.e. determining PATTERN above), and which character should
trigger composition (i.e. determining CH above).

The smaller the set of characters triggering composition is,
the more efficently Emacs' redisplay routine works.

So, Hebrew (and Latin, etc.) makes only the combining
characters trigger composition.

By the way, if the docstring of composition-function-table
is not clear, could you please suggest improvement?

---
Kenichi Handa
handa@m17n.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How is a composition being done?
  2010-08-10  1:13 ` Kenichi Handa
@ 2010-08-10 11:52   ` James Cloos
  2010-08-12  6:25     ` Kenichi Handa
  0 siblings, 1 reply; 6+ messages in thread
From: James Cloos @ 2010-08-10 11:52 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

>>>>> "KH" == Kenichi Handa <handa@m17n.org> writes:

KH>   (aset composition-function-table CH
KH>         ([PATTERN1 2 FUNC1] [PATTERN2 0 FUNC2]))

Am I correct to assume that that is what needs to be changed to make
f-ligs display?

I'd like to see emacs use f-ligs when in variable pitch mode.

My guess is that a function which applies the GSUB liga feature would be
the right solution, since monowidth fonts usualy avoid that.

Is this the right track, or should Emacs just apply liga and rlig to all
text runs?

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How is a composition being done?
  2010-08-10 11:52   ` James Cloos
@ 2010-08-12  6:25     ` Kenichi Handa
  2010-08-13 11:58       ` James Cloos
  0 siblings, 1 reply; 6+ messages in thread
From: Kenichi Handa @ 2010-08-12  6:25 UTC (permalink / raw)
  To: James Cloos; +Cc: emacs-devel

In article <m3iq3iptvp.fsf@carbon.jhcloos.org>, James Cloos <cloos@jhcloos.com> writes:

>>>>>> "KH" == Kenichi Handa <handa@m17n.org> writes:
KH>   (aset composition-function-table CH
KH>         ([PATTERN1 2 FUNC1] [PATTERN2 0 FUNC2]))

> Am I correct to assume that that is what needs to be changed to make
> f-ligs display?

What is f-ligs?  A ligature for, for instance, "Fi"?

> I'd like to see emacs use f-ligs when in variable pitch mode.

> My guess is that a function which applies the GSUB liga feature would be
> the right solution, since monowidth fonts usualy avoid that.

Yes, I think so.  But, for that, we must at first implement
a function to apply specific OpenType features.

---
Kenichi Handa
handa@m17n.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How is a composition being done?
  2010-08-12  6:25     ` Kenichi Handa
@ 2010-08-13 11:58       ` James Cloos
  2010-08-16  7:22         ` Kenichi Handa
  0 siblings, 1 reply; 6+ messages in thread
From: James Cloos @ 2010-08-13 11:58 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

>>>>> "KH" == Kenichi Handa <handa@m17n.org> writes:

>> Am I correct to assume that that is what needs to be changed to make
>> f-ligs display?

KH> What is f-ligs?  A ligature for, for instance, "Fi"?

Sorry.  Your written English is sufficiently fluent and idiomatic that
it is much too easy to forget that you are not a native speaker.

f-ligs are the lugatures which start with a miniscule f.  The most
common ones are fi, fl, ff, ffi, ffl; some fonts have fj; some even
have ligatures like fb, fk or ft which are only found at syllable
boundries.

>> I'd like to see emacs use f-ligs when in variable pitch mode.

>> My guess is that a function which applies the GSUB liga feature would be
>> the right solution, since monowidth fonts usualy avoid that.

KH> Yes, I think so.  But, for that, we must at first implement
KH> a function to apply specific OpenType features.

Yes, that would be ideal.

Perhaps the faces could specify which features should be applied, just
like they currently specify styles.  The default set could be those
which are generally applied by opentype-aware programs for the given
scripts.

I would also be useful to have a way to add features for a given span
of text.  Perahps overlays could be used (abused?) for that?

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How is a composition being done?
  2010-08-13 11:58       ` James Cloos
@ 2010-08-16  7:22         ` Kenichi Handa
  0 siblings, 0 replies; 6+ messages in thread
From: Kenichi Handa @ 2010-08-16  7:22 UTC (permalink / raw)
  To: James Cloos; +Cc: emacs-devel

In article <m3tymyhgfc.fsf@carbon.jhcloos.org>, James Cloos <cloos@jhcloos.com> writes:

> f-ligs are the lugatures which start with a miniscule f.  The most
> common ones are fi, fl, ff, ffi, ffl; some fonts have fj; some even
> have ligatures like fb, fk or ft which are only found at syllable
> boundries.

Ah, I see.

>>> I'd like to see emacs use f-ligs when in variable pitch mode.

>>> My guess is that a function which applies the GSUB liga feature would be
>>> the right solution, since monowidth fonts usualy avoid that.

KH> Yes, I think so.  But, for that, we must at first implement
KH> a function to apply specific OpenType features.

> Yes, that would be ideal.

> Perhaps the faces could specify which features should be applied, just
> like they currently specify styles.  The default set could be those
> which are generally applied by opentype-aware programs for the given
> scripts.

> I would also be useful to have a way to add features for a given span
> of text.  Perahps overlays could be used (abused?) for that?

If we make face to specify such features, we can naturally
use text property and/or overlay because both of them can
have `face' property.

---
Kenichi Handa
handa@m17n.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-16  7:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 18:29 How is a composition being done? Yair F
2010-08-10  1:13 ` Kenichi Handa
2010-08-10 11:52   ` James Cloos
2010-08-12  6:25     ` Kenichi Handa
2010-08-13 11:58       ` James Cloos
2010-08-16  7:22         ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).