ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Automatic negative tracking to prevent slight overfull hbox's
@ 2016-01-13 23:07 Alexander Dyomin
  2016-01-16 17:57 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Dyomin @ 2016-01-13 23:07 UTC (permalink / raw)
  To: ntg-context

Dear list,
when I stumble upon a slightly overhanging line (where it's not allowed to hyphenate the hanging word and putting it on next line leaves huge whitespaces), decreasing letterspacing in that line seems like a good idea, and I manually insert \kerncharacters commands to do the trick. Here's a MWE for the purpose of demonstration:

% ConTeXt code
\setuppapersize[A5]
\setupbackgrounds[text] [rightframe=on,framecolor=red,rulethickness=0.1pt] %right margin line

\setupalign[hz,hanging] % microtypography enabled
\definefontfeature[default][default][protrusion=quality,expansion=quality]

\definetypeface[mainface][rm][specserif][Linux Libertine O] [default]
\setupbodyfont[mainface,14pt]

\mainlanguage[russian]
\setupindenting[yes,medium,first]

\starttext

{\kerncharacters[-0.018] Здесь будет длинный-предлинный текст, \mbox{в~коем}} никак нельзя перенести строку. 
Запрещено { \kerncharacters[-0.008] разрывать телефонные номера, например, \mbox{(000)1234-5678}}, многозначные числа и дефисные написания.
\stoptext


Is the a way for automating such negative tracking?

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

Best regards,
Alexander Dyomin
___________________________________________________________________________________
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] 3+ messages in thread

* Re: Automatic negative tracking to prevent slight overfull hbox's
  2016-01-13 23:07 Automatic negative tracking to prevent slight overfull hbox's Alexander Dyomin
@ 2016-01-16 17:57 ` Aditya Mahajan
  2016-01-17 18:27   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2016-01-16 17:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1542 bytes --]

On Thu, 14 Jan 2016, Alexander Dyomin wrote:

> Dear list,
> when I stumble upon a slightly overhanging line (where it's not allowed to hyphenate the hanging word and putting it on next line leaves huge whitespaces), decreasing letterspacing in that line seems like a good idea, and I manually insert \kerncharacters commands to do the trick. Here's a MWE for the purpose of demonstration:
>
> % ConTeXt code
> \setuppapersize[A5]
> \setupbackgrounds[text] [rightframe=on,framecolor=red,rulethickness=0.1pt] %right margin line
>
> \setupalign[hz,hanging] % microtypography enabled
> \definefontfeature[default][default][protrusion=quality,expansion=quality]
>
> \definetypeface[mainface][rm][specserif][Linux Libertine O] [default]
> \setupbodyfont[mainface,14pt]
>
> \mainlanguage[russian]
> \setupindenting[yes,medium,first]
>
> \starttext
>
> {\kerncharacters[-0.018] Здесь будет длинный-предлинный текст, \mbox{в~коем}} никак нельзя перенести строку. 
> Запрещено { \kerncharacters[-0.008] разрывать телефонные номера, например, \mbox{(000)1234-5678}}, многозначные числа и дефисные написания.
> \stoptext
>
>
> Is the a way for automating such negative tracking?

I seem to remember seeing a demo (either by Hans or Idris) for Arabic 
typesetting where some optimizations were performed after the linebreaks. 
I wonder if similar approach could be used here.

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] 3+ messages in thread

* Re: Automatic negative tracking to prevent slight overfull hbox's
  2016-01-16 17:57 ` Aditya Mahajan
@ 2016-01-17 18:27   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2016-01-17 18:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 1/16/2016 6:57 PM, Aditya Mahajan wrote:
> On Thu, 14 Jan 2016, Alexander Dyomin wrote:
>
>> Dear list,
>> when I stumble upon a slightly overhanging line (where it's not
>> allowed to hyphenate the hanging word and putting it on next line
>> leaves huge whitespaces), decreasing letterspacing in that line seems
>> like a good idea, and I manually insert \kerncharacters commands to do
>> the trick. Here's a MWE for the purpose of demonstration:
>>
>> % ConTeXt code
>> \setuppapersize[A5]
>> \setupbackgrounds[text]
>> [rightframe=on,framecolor=red,rulethickness=0.1pt] %right margin line
>>
>> \setupalign[hz,hanging] % microtypography enabled
>> \definefontfeature[default][default][protrusion=quality,expansion=quality]
>>
>>
>> \definetypeface[mainface][rm][specserif][Linux Libertine O] [default]
>> \setupbodyfont[mainface,14pt]
>>
>> \mainlanguage[russian]
>> \setupindenting[yes,medium,first]
>>
>> \starttext
>>
>> {\kerncharacters[-0.018] Здесь будет длинный-предлинный текст,
>> \mbox{в~коем}} никак нельзя перенести строку. Запрещено {
>> \kerncharacters[-0.008] разрывать телефонные номера, например,
>> \mbox{(000)1234-5678}}, многозначные числа и дефисные написания.
>> \stoptext
>>
>>
>> Is the a way for automating such negative tracking?
>
> I seem to remember seeing a demo (either by Hans or Idris) for Arabic
> typesetting where some optimizations were performed after the
> linebreaks. I wonder if similar approach could be used here.

that assumes features in the font that can make text run wider or narrower

easier is to use \setupalign[stretch,tolerant]



-- 

-----------------------------------------------------------------
                                           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] 3+ messages in thread

end of thread, other threads:[~2016-01-17 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 23:07 Automatic negative tracking to prevent slight overfull hbox's Alexander Dyomin
2016-01-16 17:57 ` Aditya Mahajan
2016-01-17 18:27   ` Hans Hagen

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).