ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* square in Cambria font
@ 2013-04-30 11:25 Meer, H. van der
       [not found] ` <CAF=dkzx51WZxR5TYNAujJzvLd09En9rEzp=4F7Ueoyf2_RBR_g@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Meer, H. van der @ 2013-04-30 11:25 UTC (permalink / raw)
  To: NTG ConTeXt

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

I find an anomaly in the typesetting of $\square$ in the Cambria font. The $\square$ is significantly smaller then the corresponding filled squares like $\boxtimes$, etc.
Is this intrinsic to the Cambria font? Or is some encoding wrong? I tried lmodern and lucidaot and both give squares of the same size.
See the example below.

Hans van der Meer


\setuppapersize[A6][A6]
\setupbodyfont[cambria,10pt]	% TOO SMALL
%\setupbodyfont[lmodern,10pt]	% OK
%\setupbodyfont[lucidaot,10pt]	% OK
\starttext
$\square$ \string\square\crlf
$\boxdot$ \string\boxdot\crlf
$\boxplus$ \string\boxplus\crlf
$\boxtimes$ \string\boxtimes\crlf
$\boxminus$ \string\boxminus\crlf
\stoptext


[-- Attachment #2: mathbox.pdf --]
[-- Type: application/pdf, Size: 48530 bytes --]

[-- Attachment #3: 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] 4+ messages in thread

* square in Cambria font
       [not found] ` <CAF=dkzx51WZxR5TYNAujJzvLd09En9rEzp=4F7Ueoyf2_RBR_g@mail.gmail.com>
@ 2013-04-30 22:17   ` Sietse Brouwer
  2013-05-01  8:05     ` Meer, H. van der
  0 siblings, 1 reply; 4+ messages in thread
From: Sietse Brouwer @ 2013-04-30 22:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Hans,

The bad news: I think it's the font. The good news: here comes
MetaPost to the rescue!

I don't have Cambria, so I plucked a cambria.ttf file off the Internet
somewhere, which contains both Cambria and Cambria Math. I don't know
whether you have the same file/version, so YMMV, but it does exhibit
the problem you describe.

According to the lovely and free FontForge,
* the WHITE SQUARE glyph (U+25A1) is 1060 units high
* the SQUARED PLUS glyph (U+229E) is 1630 units high (of which 230
below the baseline).

This is in Cambria Math — Cambria does does not have either of these
glyphs. I suspect the square size is a design decision: that the
designers decided they wanted the white square to match the letters
rather than the 'squared *' operators.

Anyway, here's a very close MetaPost approximation of the 'squared
plus' square, made by looking in with FontForge and copying the glyph
dimensions. (And then tweaking them because some things still didn't
look right; didn't manage to fix everything, alas.) It scales with the
font size.

Cheers,
Sietse

\setuppapersize[A7][A7]
\setuppagenumber[state=stop]
\setupbodyfont[cambria,40pt]

\showframe
\showgrid

\startuseMPgraphic{square}
    numeric u, strokewd, strokeht, sqwd, sqht;
    u        := BodyFontSize / 2083;
    strokewd := 128u;
    strokeht := 123u;
    sqwd     := 1506u;
    sqht     := 1533u;
    offset   := 200u;
    pickup pensquare xscaled strokewd yscaled strokeht;
    draw unitsquare xscaled sqwd yscaled sqht;

    setbounds currentpicture to
        boundingbox currentpicture
        leftenlarged offset rightenlarged offset;
\stopuseMPgraphic

\def\mysquare{%
    \lower \dimexpr \bodyfontsize / 2083 * 234
\relax\hbox{\useMPgraphic{square}}%
}

%%%% try it out %%%%

\starttext

$\square+\mysquare\boxplus$ \crlf
$\mysquare\boxplus$

\page[yes]

$+ \ruledhbox{\boxplus}$  \crlf
$+ \ruledhbox{\mysquare}$ \crlf
$\ruledhbox{\boxplus}$  \crlf
$\ruledhbox{\mysquare}$

\stoptext
___________________________________________________________________________________
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] 4+ messages in thread

* Re: square in Cambria font
  2013-04-30 22:17   ` Sietse Brouwer
@ 2013-05-01  8:05     ` Meer, H. van der
  2013-05-01 14:51       ` Sietse Brouwer
  0 siblings, 1 reply; 4+ messages in thread
From: Meer, H. van der @ 2013-05-01  8:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks, this indeed produces a square more akin to boxtimes in Cambria. But the situation seems even worse than I thought. Under the 40pt fontsize it is apparent that lucidaot's square has a thinner outline then boxtimes. Of the three fonts I tried (cambria, lmodern, lucidaot) it seems lmodern is the only one doing it right.

Hans van der Meer



On 1 May 2013, at 12:17 AM, Sietse Brouwer <sbbrouwer@gmail.com>
 wrote:

> Hello Hans,
> 
> The bad news: I think it's the font. The good news: here comes
> MetaPost to the rescue!
> 
> I don't have Cambria, so I plucked a cambria.ttf file off the Internet
> somewhere, which contains both Cambria and Cambria Math. I don't know
> whether you have the same file/version, so YMMV, but it does exhibit
> the problem you describe.
> 
> According to the lovely and free FontForge,
> * the WHITE SQUARE glyph (U+25A1) is 1060 units high
> * the SQUARED PLUS glyph (U+229E) is 1630 units high (of which 230
> below the baseline).
> 
> This is in Cambria Math — Cambria does does not have either of these
> glyphs. I suspect the square size is a design decision: that the
> designers decided they wanted the white square to match the letters
> rather than the 'squared *' operators.
> 
> Anyway, here's a very close MetaPost approximation of the 'squared
> plus' square, made by looking in with FontForge and copying the glyph
> dimensions. (And then tweaking them because some things still didn't
> look right; didn't manage to fix everything, alas.) It scales with the
> font size.
> 
> Cheers,
> Sietse
> 
> \setuppapersize[A7][A7]
> \setuppagenumber[state=stop]
> \setupbodyfont[cambria,40pt]
> 
> \showframe
> \showgrid
> 
> \startuseMPgraphic{square}
>    numeric u, strokewd, strokeht, sqwd, sqht;
>    u        := BodyFontSize / 2083;
>    strokewd := 128u;
>    strokeht := 123u;
>    sqwd     := 1506u;
>    sqht     := 1533u;
>    offset   := 200u;
>    pickup pensquare xscaled strokewd yscaled strokeht;
>    draw unitsquare xscaled sqwd yscaled sqht;
> 
>    setbounds currentpicture to
>        boundingbox currentpicture
>        leftenlarged offset rightenlarged offset;
> \stopuseMPgraphic
> 
> \def\mysquare{%
>    \lower \dimexpr \bodyfontsize / 2083 * 234
> \relax\hbox{\useMPgraphic{square}}%
> }
> 
> %%%% try it out %%%%
> 
> \starttext
> 
> $\square+\mysquare\boxplus$ \crlf
> $\mysquare\boxplus$
> 
> \page[yes]
> 
> $+ \ruledhbox{\boxplus}$  \crlf
> $+ \ruledhbox{\mysquare}$ \crlf
> $\ruledhbox{\boxplus}$  \crlf
> $\ruledhbox{\mysquare}$
> 
> \stoptext
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

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

* Re: square in Cambria font
  2013-05-01  8:05     ` Meer, H. van der
@ 2013-05-01 14:51       ` Sietse Brouwer
  0 siblings, 0 replies; 4+ messages in thread
From: Sietse Brouwer @ 2013-05-01 14:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Of the three fonts I tried (cambria, lmodern,
> lucidaot) it seems lmodern is the only one
> doing it right.

Depends on what is required to 'do it right' --- the Unicode reference
doesn't mention any mathematical use for U+25A1 white square, so I'm
not sure that "must match squared plus glyph" is a requirement.
Perhaps the creators of Cambria expected the glyph to be used for
itemizations, or footnote marks.

Out of curiosity: what are you using the square for / what does it
stand for, that makes matching squared plus so important to you? There
might even exist some other glyph that is semantically more suitable.

Cheers,
Sietse

On 1 May 2013 10:05, Meer, H. van der <H.vanderMeer@uva.nl> wrote:
> Thanks, this indeed produces a square more akin to boxtimes in Cambria. But the situation seems even worse than I thought. Under the 40pt fontsize it is apparent that lucidaot's square has a thinner outline then boxtimes. Of the three fonts I tried (cambria, lmodern, lucidaot) it seems lmodern is the only one doing it right.
>
> Hans van der Meer
>
>
>
> On 1 May 2013, at 12:17 AM, Sietse Brouwer <sbbrouwer@gmail.com>
>  wrote:
>
>> Hello Hans,
>>
>> The bad news: I think it's the font. The good news: here comes
>> MetaPost to the rescue!
>>
>> I don't have Cambria, so I plucked a cambria.ttf file off the Internet
>> somewhere, which contains both Cambria and Cambria Math. I don't know
>> whether you have the same file/version, so YMMV, but it does exhibit
>> the problem you describe.
>>
>> According to the lovely and free FontForge,
>> * the WHITE SQUARE glyph (U+25A1) is 1060 units high
>> * the SQUARED PLUS glyph (U+229E) is 1630 units high (of which 230
>> below the baseline).
>>
>> This is in Cambria Math — Cambria does does not have either of these
>> glyphs. I suspect the square size is a design decision: that the
>> designers decided they wanted the white square to match the letters
>> rather than the 'squared *' operators.
>>
>> Anyway, here's a very close MetaPost approximation of the 'squared
>> plus' square, made by looking in with FontForge and copying the glyph
>> dimensions. (And then tweaking them because some things still didn't
>> look right; didn't manage to fix everything, alas.) It scales with the
>> font size.
>>
>> Cheers,
>> Sietse
>>
>> \setuppapersize[A7][A7]
>> \setuppagenumber[state=stop]
>> \setupbodyfont[cambria,40pt]
>>
>> \showframe
>> \showgrid
>>
>> \startuseMPgraphic{square}
>>    numeric u, strokewd, strokeht, sqwd, sqht;
>>    u        := BodyFontSize / 2083;
>>    strokewd := 128u;
>>    strokeht := 123u;
>>    sqwd     := 1506u;
>>    sqht     := 1533u;
>>    offset   := 200u;
>>    pickup pensquare xscaled strokewd yscaled strokeht;
>>    draw unitsquare xscaled sqwd yscaled sqht;
>>
>>    setbounds currentpicture to
>>        boundingbox currentpicture
>>        leftenlarged offset rightenlarged offset;
>> \stopuseMPgraphic
>>
>> \def\mysquare{%
>>    \lower \dimexpr \bodyfontsize / 2083 * 234
>> \relax\hbox{\useMPgraphic{square}}%
>> }
>>
>> %%%% try it out %%%%
>>
>> \starttext
>>
>> $\square+\mysquare\boxplus$ \crlf
>> $\mysquare\boxplus$
>>
>> \page[yes]
>>
>> $+ \ruledhbox{\boxplus}$  \crlf
>> $+ \ruledhbox{\mysquare}$ \crlf
>> $\ruledhbox{\boxplus}$  \crlf
>> $\ruledhbox{\mysquare}$
>>
>> \stoptext
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2013-05-01 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 11:25 square in Cambria font Meer, H. van der
     [not found] ` <CAF=dkzx51WZxR5TYNAujJzvLd09En9rEzp=4F7Ueoyf2_RBR_g@mail.gmail.com>
2013-04-30 22:17   ` Sietse Brouwer
2013-05-01  8:05     ` Meer, H. van der
2013-05-01 14:51       ` Sietse Brouwer

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