* Underbar offset
@ 2016-05-23 23:54 Mojca Miklavec
2016-05-24 12:19 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Mojca Miklavec @ 2016-05-23 23:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
I would like to add a continuous underbar under a paragraph or a title as in:
\setupbar
[color=red,offset=10pt]
\starttext
\underbar{Test this \high{\tfxx ®}}
\stoptext
... but I'm confused about two aspects:
- How can I prevent \high{} from shifting the underbar?
- How can I add more offset?
The color keyword works, but offset doesn't seem to have any effect
even though it's listed in the reference.
I was able to address the second problem (adding more offset) with
something like
\definebar[BarU][offset=-0.7]
\startbar[BarU] ... \stopbar
but I wasn't able to get rid of the shift (and the bar had a different
thickness when a smaller font was used).
I can find ugly workarounds with frames, but it would be ideal if I
could get one of the underbar mechanisms to work "out-of-the-box".
Thank you,
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-23 23:54 Underbar offset Mojca Miklavec
@ 2016-05-24 12:19 ` Hans Hagen
2016-05-25 15:35 ` Wolfgang Schuster
0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2016-05-24 12:19 UTC (permalink / raw)
To: ntg-context
On 5/24/2016 1:54 AM, Mojca Miklavec wrote:
> Hi,
>
> I would like to add a continuous underbar under a paragraph or a title as in:
>
> \setupbar
> [color=red,offset=10pt]
> \starttext
> \underbar{Test this \high{\tfxx ®}}
> \stoptext
>
> ... but I'm confused about two aspects:
>
> - How can I prevent \high{} from shifting the underbar?
i need to think about it .. maybe an option
> - How can I add more offset?
underbar is derived from the parent but has its own offset and an offset
is relative to the baseline and a fraction of th eunit (normally the ex
of a font)
\setupbar[underbar][color=red,offset=-.5]
\starttext
\underbar{Test this \high{\tfxx ®}}
\stoptext
> The color keyword works, but offset doesn't seem to have any effect
> even though it's listed in the reference.
>
> I was able to address the second problem (adding more offset) with
> something like
> \definebar[BarU][offset=-0.7]
> \startbar[BarU] ... \stopbar
> but I wasn't able to get rid of the shift (and the bar had a different
> thickness when a smaller font was used).
>
> I can find ugly workarounds with frames, but it would be ideal if I
> could get one of the underbar mechanisms to work "out-of-the-box".
just see how underbar is defined ... if you want fixed dimensions you
should used a fixed unit (not one derived from the current font)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-24 12:19 ` Hans Hagen
@ 2016-05-25 15:35 ` Wolfgang Schuster
2016-05-26 12:48 ` Mojca Miklavec
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2016-05-25 15:35 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]
> Hans Hagen <mailto:pragma@wxs.nl>
> 24. Mai 2016 um 14:19
> On 5/24/2016 1:54 AM, Mojca Miklavec wrote:
>> Hi,
>>
>> I would like to add a continuous underbar under a paragraph or a
>> title as in:
>>
>> \setupbar
>> [color=red,offset=10pt]
>> \starttext
>> \underbar{Test this \high{\tfxx ®}}
>> \stoptext
>>
>> ... but I'm confused about two aspects:
>>
>> - How can I prevent \high{} from shifting the underbar?
>
> i need to think about it .. maybe an option
>
>> - How can I add more offset?
>
> underbar is derived from the parent but has its own offset and an
> offset is relative to the baseline and a fraction of th eunit
> (normally the ex of a font)
>
> \setupbar[underbar][color=red,offset=-.5]
>
> \starttext
>
> \underbar{Test this \high{\tfxx ®}}
>
> \stoptext
With \shiftup the line under the raised text stays at the same position.
\starttext
\underbar{Test this \shiftup{®}}
\stoptext
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 2095 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-25 15:35 ` Wolfgang Schuster
@ 2016-05-26 12:48 ` Mojca Miklavec
2016-05-26 13:10 ` Marco Patzer
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Mojca Miklavec @ 2016-05-26 12:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 25 May 2016 at 17:35, Wolfgang Schuster wrote:
>
> With \shiftup the line under the raised text stays at the same position.
>
> \starttext
> \underbar{Test this \shiftup{®}}
> \stoptext
When has \shiftup been implemented?
It doesn't work in TeX Live (or maybe I forgot to update TL to the
latest version), but works with the latest version of ConTeXt.
Nevertheless this doesn't entirely solve the problem. I now have a
problem with the following:
\catcode`č=\active
\defč{\buildtextaccent\textcaron c}
\underbar{Test this č}
I will try to remember how to fix the font on the fly with lua (or
perhaps figure out how to edit the font; it's a commercial font
though, so fixing it "on the fly" would probably be better).
I will also test some other piece of code that Hans sent me off-list.
(I seem to remember that there must be some tens of ways to underline
text. Every now and then Hans sends a new demo.)
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-26 12:48 ` Mojca Miklavec
@ 2016-05-26 13:10 ` Marco Patzer
2016-05-26 15:20 ` Aditya Mahajan
2016-05-26 16:17 ` Hans Hagen
2 siblings, 0 replies; 8+ messages in thread
From: Marco Patzer @ 2016-05-26 13:10 UTC (permalink / raw)
To: ntg-context
On Thu, 26 May 2016 14:48:00 +0200
Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:
> On 25 May 2016 at 17:35, Wolfgang Schuster wrote:
> >
> > With \shiftup the line under the raised text stays at the same
> > position.
> >
> > \starttext
> > \underbar{Test this \shiftup{®}}
> > \stoptext
>
> When has \shiftup been implemented?
The git history first mentions it on 2015.12.22. I didn't know that
command, either.
Marco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-26 12:48 ` Mojca Miklavec
2016-05-26 13:10 ` Marco Patzer
@ 2016-05-26 15:20 ` Aditya Mahajan
2016-05-26 16:17 ` Hans Hagen
2 siblings, 0 replies; 8+ messages in thread
From: Aditya Mahajan @ 2016-05-26 15:20 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: TEXT/PLAIN, Size: 251 bytes --]
On Thu, 26 May 2016, Mojca Miklavec wrote:
> \catcode`č=\active
> \defč{\buildtextaccent\textcaron c}
Instead of creating an active character, does this work:
\definefontfeature
[default]
[default]
[compose=yes]
Aditya
[-- 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-26 12:48 ` Mojca Miklavec
2016-05-26 13:10 ` Marco Patzer
2016-05-26 15:20 ` Aditya Mahajan
@ 2016-05-26 16:17 ` Hans Hagen
2016-05-26 17:24 ` Mojca Miklavec
2 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2016-05-26 16:17 UTC (permalink / raw)
To: ntg-context
On 5/26/2016 2:48 PM, Mojca Miklavec wrote:
> On 25 May 2016 at 17:35, Wolfgang Schuster wrote:
>>
>> With \shiftup the line under the raised text stays at the same position.
>>
>> \starttext
>> \underbar{Test this \shiftup{®}}
>> \stoptext
>
> When has \shiftup been implemented?
>
> It doesn't work in TeX Live (or maybe I forgot to update TL to the
> latest version), but works with the latest version of ConTeXt.
it has always been there but recently i saw that when i had updated some
low level stuff (to new luatex) i had forgotten something, so i fixed that
> Nevertheless this doesn't entirely solve the problem. I now have a
> problem with the following:
>
> \catcode`č=\active
> \defč{\buildtextaccent\textcaron c}
doesn't the compose=yes feature work?
> \underbar{Test this č}
>
> I will try to remember how to fix the font on the fly with lua (or
> perhaps figure out how to edit the font; it's a commercial font
> though, so fixing it "on the fly" would probably be better).
>
> I will also test some other piece of code that Hans sent me off-list.
> (I seem to remember that there must be some tens of ways to underline
> text. Every now and then Hans sends a new demo.)
so let's give you another piece
\startluacode
fonts.handlers.otf.addfeature {
name = "mojca",
type = "multiple",
prepend = true,
data = {
["č"] = { 0x30C, "c" },
}
}
fonts.handlers.otf.addfeature {
name = "kern",
type = "pair",
data = {
[0x30C] = { c = { { 500, 0, 0, 0 }, false } },
}
}
\stopluacode
\definefontfeature[default][default][mojca=yes]
\showframe
\starttext
mojča miklave\utfchar{"30C}c
\stoptext
(actually it uncovered a buglet but i suppose the č never is the first
char so ...)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Underbar offset
2016-05-26 16:17 ` Hans Hagen
@ 2016-05-26 17:24 ` Mojca Miklavec
0 siblings, 0 replies; 8+ messages in thread
From: Mojca Miklavec @ 2016-05-26 17:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 26 May 2016 at 18:17, Hans Hagen wrote:
> On 5/26/2016 2:48 PM, Mojca Miklavec wrote:
>>
>> Nevertheless this doesn't entirely solve the problem. I now have a
>> problem with the following:
>>
>> \catcode`č=\active
>> \defč{\buildtextaccent\textcaron c}
>
>
> doesn't the compose=yes feature work?
I'm sorry, compose=yes works as expected (I was copy pasting some old
code and forgot about the later improvements in ConTeXt: shame on me).
> so let's give you another piece
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "mojca",
> type = "multiple",
> prepend = true,
> data = {
> ["č"] = { 0x30C, "c" },
> }
> }
> fonts.handlers.otf.addfeature {
> name = "kern",
> type = "pair",
> data = {
> [0x30C] = { c = { { 500, 0, 0, 0 }, false } },
> }
> }
> \stopluacode
>
> \definefontfeature[default][default][mojca=yes]
>
> \showframe
>
> \starttext
>
> mojča miklave\utfchar{"30C}c
>
> \stoptext
>
> (actually it uncovered a buglet but i suppose the č never is the first char
> so ...)
But the code above doesn't seem to work (I don't get the letter "č"
printed out at all). I would prefer the approach with more fine-tuning
though because "č" is always misaligned. And I seem to remember that
this functionality has been in the core for a long time already, I
just again forgot about it because most fonts include the full charset
nowadays.
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-05-26 17:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 23:54 Underbar offset Mojca Miklavec
2016-05-24 12:19 ` Hans Hagen
2016-05-25 15:35 ` Wolfgang Schuster
2016-05-26 12:48 ` Mojca Miklavec
2016-05-26 13:10 ` Marco Patzer
2016-05-26 15:20 ` Aditya Mahajan
2016-05-26 16:17 ` Hans Hagen
2016-05-26 17:24 ` Mojca Miklavec
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).