Re: Problem with a font

2018-04-06 Thread Torsten Hämmerle
David Kastrup wrote
> It may be that the "prescribed" music font here similarly is a
> same-purpose clone of something saner in which case a replacement will
> quite likely go unnoticed anyway.

In this very special case there is an unparalleled mismatch between upper
and lower case letters:
The upper case letters have nothing in common with handwritten letters, they
look like sans-serif font, obviously they represent block letters.
The lower case letters, however, are joined like in classic elementary
school script fonts.

The combination of the two looks so terrible and I first thought there were
no capital letters in Escolar so that they are taken from another font.

I guess it's hard to find a replacement font combining non-script capitals
and script lower case letters.
I believe number 2 has been an accident. :)

All in all, this font is quite unique. In a bad sense, but: unique.
Replacing Frankenstein's Monster without anybody noticing? 

All the best
Torsten





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread David Kastrup
Walter Garcia-Fontes  writes:

> * Simon Albrecht, simon.albre...@mail.de [06/04/18 10:53]:
>> Why not use a similar, but better, font without telling them? Maybe
>> they won’t notice, or if they will, maybe it will be a positive
>> reaction, or if not, you have good arguments at hand for telling them
>> why your alternative is better, in terms of professional typography.
>
> Believe me, I tried. Some of you may know how stubborn some people may
> be, even if they have something better in front of their noses.

I've already encountered the situation that I had a prescribed style
sheet calling for Arial fonts and the sample sheets from a previous
publisher clearly showed Helvetica (quite easier to achieve with a
TeX-based workflow so I was quite relieved).

It may be that the "prescribed" music font here similarly is a
same-purpose clone of something saner in which case a replacement will
quite likely go unnoticed anyway.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread David Kastrup
Walter Garcia-Fontes  writes:

> * Andrew Bernard, andrew.bern...@gmail.com [06/04/18 04:35]:
>> 
>> If you need to find a proper fonts, I'd be very happy to assist you to
>> locate something that is similar to the one you have to work with. Can you
>> convince the customer to use something better?
>
> Thanks Andrew. This is actually for my daughter, who is writing the
> books for a music academy where she works as a music teacher. My
> daughter learned LilyPond from me when she was studying, since she was
> very young, and now she never stops astonishing her bosses with the
> speed and beauty that she can produce with LilyPond. There are other
> people using other music engraving software there, and she has beat
> them all. Now she produces the books for music language and all
> instruments, they all have given up, especially because of how fast
> she can produce beautiful scores for individual instruments or
> assemblies. But this is off topic, I guess.

We need more off topic postings then.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread Torsten Hämmerle
Walter Garcia-Fontes wrote
> [...] but her bosses are stubborn to use that one, which is used in
> schools here in Spain, and so they are used to it.

Hi Walter,

Everything Andrew said is exactly how I feel about it.
But I can see the point that Escolar is intended for didactic use (hence the
name...) and has not been created to look good but to serve as a didactic
font for learning how to write.
We have similar fonts in Germany (called "Ausgangsschrift") - the more
"modern"/simplified, the more ugly. ;)

But apart from that, the Escolar font is poorly crafted in my opinion and,
well, we can't change that.

*Bold, italic etc.*
A font mimicking handwriting should never italicized for emphasis, because
you would never do that in handwriting.
The same goes for bold (although on could use a thicker pen).
In handwriting, underlining would be the way to go (even if underlining is a
bad way of emphasis in printed text).


*Fake bold and fake italics*
should always be a last resort.


*Many Teachers...*
... tend to over-use bold text because they think that everything is
important and never learned anything about typography (neither at school nor
at the university). That always made me wonder because producing texts is an
integral part of their daily work.

As Andrew already stated, Escolar2 Negra (!!!) actually /is/ a bold font
(cf. Arial Black) and there is Escolar 1 as a regular version (that nobody
seems to be using, though).


*Apart from that...*
I've had had a look what Office does (Open Office in my case) and tried to
mimic its behaviour in our LilyPond markup commands.
Regardless of any typographic aspects, the LilyPond output should match the
Open Office (or Libre Office or Microsoft Office) output that the children
are used to.

Here's a comparison of Open Office's fake bold/italic and my corresponding
LilyPond emulations:

 

You've already created your own \bolded-command (very good!). In my version,
I use several overrides to get rid of the "zigzag" outlines of a single
shift (see the letter "s" for example).

Here's what I did (\slanted and \fake-bold):

%% BEGIN OF SNIPPET
\version "2.18.2"

#(define-markup-command
  (fake-bold layout props arg)
  (markup?)
  #:category font
  #:properties ((shift 0.009))
  "Fake a bold font"
  (let* ((stencil (interpret-markup layout props arg)))
(set! stencil
  (ly:stencil-add
   stencil
   (ly:stencil-translate-axis stencil shift X)
   (ly:stencil-translate-axis stencil (* 2 shift) X)))
(ly:stencil-add
 stencil
 (ly:stencil-translate-axis stencil (* 3 shift) X

#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 19))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
 (alpha-deg (* (/ 180 PI) alpha-rad))
 (stencil
  (if (markup? arg)
  (interpret-markup layout props arg)
  empty-stencil))
 (x-ext (ly:stencil-extent stencil X))
 (y-ext (ly:stencil-extent stencil Y)))
(ly:make-stencil
 (ly:stencil-expr
  (ly:stencil-scale
   (ly:stencil-rotate
(ly:stencil-scale
 (ly:stencil-rotate
  (ly:make-stencil (ly:stencil-expr stencil) (cons 0 0) (cons 0 0))
  45 0 0)
 1
 (* (tan alpha-rad)))
(* (- alpha-deg)) 0 0)
   (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad
 x-ext y-ext)))

\markup \override #'(font-name . "Escolar2") \column {
  "This is Escolar 2"
  \fake-bold "This is bold in Lilypond"
  \slanted "This is italic in Lilypond"
}
%% END OF SNIPPET


All the best
Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread Thomas Morley
Hi Walter,



2018-04-06 9:49 GMT+02:00 Walter Garcia-Fontes :
> * Torsten Hämmerle, torsten.haemme...@web.de [05/04/18 20:48]:
>> A missing bold font can be emulated by printing the stencil several times
>> (slightly shifted) - like in Don E. Knuth's "poor man's bold" (TeX).
>>
>> If you get stuck, don't hesitate to ask.
>
> OK, here is an ugly solution (font experts please look somewhere
> else):

I'm not a font expert ;)

However, I thought it might be nice to have commands to fake
text-appearance, if the font-to-use doesn't deliver what' needed.
We already have
smallCaps-markup
slanted-markup by Torsten
Below my approach for poor-mans-bold-markup and in combination with \slanted
It uses `stencil-whiteout-outline' which is already in 2.19, here
downgraded to make it work with 2.18.2

\version "2.18.2"

#(define*-public (stencil-whiteout-outline
 stil #:optional (thickness 0.3) (color white)
 (angle-increments 16) (radial-increments 1))
  "This function works by creating a series of white or @var{color}
stencils radially offset from the original stencil with angles from
0 to 2*pi, at an increment of @code{angle-inc}, and with radii
from @code{radial-inc} to @var{thickness}.  @var{thickness} is how big
the white outline is, as a multiple of line-thickness.
@var{radial-increments} is how many copies of the white stencil we make
on our way out to thickness.  @var{angle-increments} is how many copies
of the white stencil we make between 0 and 2*pi."
  (if (or (not (positive? angle-increments))
  (not (positive? radial-increments)))
  (begin
   (ly:warning
"Both angle-increments and radial-increments must be positive numbers.")
   stil)
  (let* ((angle-inc (/ 360 angle-increments))
 (radial-inc (/ thickness radial-increments)))

(define (circle-plot ang dec radius original-stil new-stil)
  ;; ang (angle) and dec (decrement) are in degrees, not radians
  (if (<= ang 0)
  new-stil
  (circle-plot (- ang dec) dec radius original-stil
(ly:stencil-add
 new-stil
 (ly:stencil-translate original-stil
   ;(ly:directed ang radius)
   ;; 2.18.2:
   (cons
 (* radius (cos (degrees->radians ang)))
 (* radius (sin (degrees->radians ang
   )

(define (radial-plot radius original-stil new-stil)
  (if (<= radius 0)
  new-stil
  (ly:stencil-add new-stil
(radial-plot
 (- radius radial-inc)
 original-stil
 (circle-plot 360 angle-inc
   radius original-stil empty-stencil)

(let ((whiteout-expr
(ly:stencil-expr
 (stencil-with-color
  (radial-plot thickness stil empty-stencil)
  color
  (ly:stencil-add
(ly:make-stencil
  `(delay-stencil-evaluation ,(delay whiteout-expr)))
stil)

#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 12))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
 (alpha-deg (* (/ 180 PI) alpha-rad))
 (stencil
  (if (markup? arg)
  (interpret-markup layout props arg)
  empty-stencil))
 (x-ext (ly:stencil-extent stencil X))
 (y-ext (ly:stencil-extent stencil Y)))
(ly:make-stencil
  (ly:stencil-expr
(ly:stencil-scale
  (ly:stencil-rotate
(ly:stencil-scale
  (ly:stencil-rotate
(ly:make-stencil
  (ly:stencil-expr stencil)
  (cons 0 0)
  (cons 0 0))
45 0 0)
  1
  (* (tan alpha-rad)))
   (* (- alpha-deg)) 0 0)
 (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad
  x-ext
  y-ext)))

#(define-markup-command (poor-mans-bold layout props arg)(markup?)
  #:properties ((thickness 0.03)
(color black)
(angle-increments 4)
(radial-increments 1))
   ;; Currently the entire stencil of `arg' will be outlined.
   ;; TODO better results by splitting `arg' in characters, outlining them
   ;;  and putting them together again?
   ;;  -> smallCaps
   (stencil-whiteout-outline
 (interpret-markup layout props
   arg)
   thickness
   color
   angle-increments
   radial-increments))

tst =
\markup
  \override #'(font-name . "Escolar2")
  %\override #'(font-name . "Purisa")
  %\override #'(font-name . "Times New Roman,")
  \wordwrap {
Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua.  Ut enim ad minim ven

Re: Problem with a font

2018-04-06 Thread Walter Garcia-Fontes
* Simon Albrecht, simon.albre...@mail.de [06/04/18 10:53]:
> Why not use a similar, but better, font without telling them? Maybe they
> won’t notice, or if they will, maybe it will be a positive reaction, or if
> not, you have good arguments at hand for telling them why your alternative
> is better, in terms of professional typography.

Believe me, I tried. Some of you may know how stubborn some people may
be, even if they have something better in front of their noses.

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread Andrew Bernard
Hi Walter,

If you must use that font for educational purposes in Spain, here is a page
that has a normal version and a black (negra) of Escolar, which as far as I
can see is the same font.

http://www.edu.xunta.gal/centros/ceipfrions/es/node/101

You may want more black than this, but the contrast in colour between these
two is pretty good, and very much the norm in typography.

As for italic, well if children are learning good handwriting from this,
then applying an algorithmic slant is a terrible way to show children how
to write. Italic handwriting is fundamentally different to upright. But
perhaps things are done with a different sense in Spain (no disrespect
intended).

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread Simon Albrecht

On 06.04.2018 07:21, Walter Garcia-Fontes wrote:

I already showed her different alternatives, that we found around for
hand writing fonts, both free and commercial, but her bosses are
stubborn to use that one, which is used in schools here in Spain, and
so they are used to it.


Why not use a similar, but better, font without telling them? Maybe they 
won’t notice, or if they will, maybe it will be a positive reaction, or 
if not, you have good arguments at hand for telling them why your 
alternative is better, in terms of professional typography.


Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-06 Thread Walter Garcia-Fontes
* Torsten Hämmerle, torsten.haemme...@web.de [05/04/18 20:48]:
> A missing bold font can be emulated by printing the stencil several times
> (slightly shifted) - like in Don E. Knuth's "poor man's bold" (TeX).
> 
> If you get stuck, don't hesitate to ask.

OK, here is an ugly solution (font experts please look somewhere
else):

(to download the font:
http://www.edu.xunta.gal/centros/ceipfrions/system/files/u1/Escolar_2_Negra.zip)

\version "2.18.2"

% BEGIN OF SNIPPET
#(define-markup-command (bolded layout props text) (markup?)
  #:properties ((translate-x 0.07))
  "Fake a bold font"
(interpret-markup layout props
(markup #:combine text  #:translate '(0.07 . 0) text)))

\markup{\override #'(font-name . "Escolar2") {"this is normal"}}
\markup{\override #'(font-name . "Escolar2") {\bolded "this is
bolded"}}

I got stuck in coding the translate-x value inside the last line, I
would know how to do it for a single value property, but I haven't
found how to do it for a pair of value, that is substitute 0.07 by a
value that can be substituted by \override #'(tranlate-x . 0.05) for
instance. 

Walter


-- 
Walter Garcia-Fontes
L'Hospitalet

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-05 Thread Walter Garcia-Fontes
* Andrew Bernard, andrew.bern...@gmail.com [06/04/18 04:35]:
> Are you required by your customer or client to use this exact font? There
> are so many things wrong with it typographically it's hard to know where to
> start.
> 
> If you need a childlike cursive script, font, there are thousands available
> that are built professionally with proper fonr metrics. As has alreayd been
> explained on the list, Writer fakes italic and bold when not available, and
> to the discrominating eye this always looks terrible. A correct italic is
> not just slanted Roman. Most handwriting script fonts don't have italic
> versions, but some do.
> 
> If you need to find a proper fonts, I'd be very happy to assist you to
> locate something that is similar to the one you have to work with. Can you
> convince the customer to use something better?

Thanks Andrew. This is actually for my daughter, who is writing the
books for a music academy where she works as a music teacher. My
daughter learned LilyPond from me when she was studying, since she was
very young, and now she never stops astonishing her bosses with the
speed and beauty that she can produce with LilyPond. There are other
people using other music engraving software there, and she has beat
them all. Now she produces the books for music language and all
instruments, they all have given up, especially because of how fast
she can produce beautiful scores for individual instruments or
assemblies. But this is off topic, I guess.

I already showed her different alternatives, that we found around for
hand writing fonts, both free and commercial, but her bosses are
stubborn to use that one, which is used in schools here in Spain, and
so they are used to it.

But since I do not know about font internals, I will tell her about
your comments, which are very useful. 

Walter

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-05 Thread Andrew Bernard
Hi Walter,

Are you required by your customer or client to use this exact font? There
are so many things wrong with it typographically it's hard to know where to
start.

If you need a childlike cursive script, font, there are thousands available
that are built professionally with proper fonr metrics. As has alreayd been
explained on the list, Writer fakes italic and bold when not available, and
to the discrominating eye this always looks terrible. A correct italic is
not just slanted Roman. Most handwriting script fonts don't have italic
versions, but some do.

If you need to find a proper fonts, I'd be very happy to assist you to
locate something that is similar to the one you have to work with. Can you
convince the customer to use something better?

Andrew



On 3 April 2018 at 04:10, Walter Garcia-Fontes 
wrote:

> I have a problem using this font:
>
> http://puna.upf.edu/Escolar_N.ttf
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-05 Thread Torsten Hämmerle
Walter Garcia-Fontes wrote
> I take the homework to try to code a snippet that would "bold" the
> font. That must be harder, not that I not find hard the above code.

Hi Walter,

Just a hint:
A missing bold font can be emulated by printing the stencil several times
(slightly shifted) - like in Don E. Knuth's "poor man's bold" (TeX).

If you get stuck, don't hesitate to ask.

All the best,
Torsten





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-05 Thread Walter Garcia-Fontes
Thanks a lot Torsten. I got such great responses, that I think it is
worth it to finish this thread with a short summary. 

The problem arose with a font which can be downloaded from here:

http://www.edu.xunta.gal/centros/ceipfrions/system/files/u1/Escolar_2_Negra.zip

This is a handwriting font. If I use it in a word processing system,
like LibreOffice Writer, I get a correct apostroph, but if I use it in
LilyPond with the following code, the apostroph comes too low:

\version "2.18.2"

\paper {
   #(define fonts
  (make-pango-font-tree
   "Escolar2"
   "Escolar2"
   "Escolar2"
   (/ staff-height pt 20)))
}

\markup{This is showing the problem '}

The problem is caused because actually the character ' is defined in
this font very low, so LilyPond does the right thing. Instead what
LibreOffice does it to substitute this character by a typographic
apostroph: ’. Since (at least I) we use a text editor to code LilyPond, we
do not get this typographic apostroph. I use emacs, and to get this
character I have to do the following: 
control + x + 8 + RET , and then enter 2019. 

If I use this character, LilyPond renders the apostroph exactly as
Writer. 

LibreOffice Writer is actually also able to slant and bold this font,
without having specific bold and slant versions for the font. LilyPond
actually is also able to do it, for instance slant can be gotten by this
snippet: 

> % BEGIN OF SNIPPET
#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 12))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
 (alpha-deg (* (/ 180 PI) alpha-rad))
 (stencil
  (if (markup? arg)
  (interpret-markup layout props arg)
  empty-stencil))
 (x-ext (ly:stencil-extent stencil X))
 (y-ext (ly:stencil-extent stencil Y)))
(ly:make-stencil
 (ly:stencil-expr
  (ly:stencil-scale
   (ly:stencil-rotate
(ly:stencil-scale
 (ly:stencil-rotate
  (ly:make-stencil (ly:stencil-expr stencil) (cons 0 0) (cons 0 0))
  45 0 0)
 1
 (* (tan alpha-rad)))
(* (- alpha-deg)) 0 0)
   (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad
 x-ext y-ext)))
% END OF SNIPPET

I take the homework to try to code a snippet that would "bold" the
font. That must be harder, not that I not find hard the above code.

Thanks a lot to everybody who answered in this thread,

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-05 Thread Torsten Hämmerle
Walter Garcia-Fontes wrote
> I get an error in your code for "slanting" the font: [...]

Hi Walter,

The ly:stencil-outline command did not exist in 2.18.2 yet.
Here's a downgraded version of \slanted:

% BEGIN OF SNIPPET
#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 12))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
 (alpha-deg (* (/ 180 PI) alpha-rad))
 (stencil
  (if (markup? arg)
  (interpret-markup layout props arg)
  empty-stencil))
 (x-ext (ly:stencil-extent stencil X))
 (y-ext (ly:stencil-extent stencil Y)))
(ly:make-stencil
 (ly:stencil-expr
  (ly:stencil-scale
   (ly:stencil-rotate
(ly:stencil-scale
 (ly:stencil-rotate
  (ly:make-stencil (ly:stencil-expr stencil) (cons 0 0) (cons 0 0))
  45 0 0)
 1
 (* (tan alpha-rad)))
(* (- alpha-deg)) 0 0)
   (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad
 x-ext y-ext)))
% END OF SNIPPET

HTH,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-04 Thread Simon Albrecht

On 03.04.2018 17:30, Walter Garcia-Fontes wrote:

Just a question, sorry if it is obvious, what do you mean by
"typographic apostrophes/quotation marks"?


Wikipedia is very good on that topic:



Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Thomas Morley
2018-04-03 18:31 GMT+02:00 Walter Garcia-Fontes :

> I get an error in your code for "slanting" the font:
>
> Parsing...letras.ly:18:5:
> In expression (ly:stencil-outline (ly:stencil-scale # # ...) stencil):
> letras.ly:18:5: Unbound variable: ly:stencil-outline

Ah yes, it's not available in 2.18., which I suppose you're using.

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Flaming Hakama by Elaine
> Subject: Re: Problem with a font
> 2018-04-03 17:30 GMT+02:00 Walter Garcia-Fontes :
>


> > Just a question, sorry if it is obvious, what do you mean by
> > "typographic apostrophes/quotation marks"?
> >
> > --
> > Walter Garcia-Fontes
> > L'Hospitalet de Llobregat
>
>
>
> Probably:  ‘ or ’
>
>
Which is to say, typographic quotes are paired, with different symbols for
the start and end quote.  (Or at least, different orientations of the same
symbol.)


David Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Walter Garcia-Fontes
* Thomas Morley, thomasmorle...@gmail.com [03/04/18 17:40]:
> > Just a question, sorry if it is obvious, what do you mean by
> > "typographic apostrophes/quotation marks"?
> >
> 
> 
> 
> Probably:  ‘ or ’
> 
> As for italic you may try Torsten's markup-command `slanted' from:
> http://lilypond.1069038.n5.nabble.com/How-to-prevent-ly-stencil-rotate-to-modify-dimensions-tt210800.html
> 
> Leading to:
> 
> #(define-markup-command
>   (slanted layout props arg)
>   (markup?)
>   #:category font
>   #:properties ((slant-angle 12))
>   "Fake a slanted font"
>   (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
>   (alpha-deg (* (/ 180 PI) alpha-rad))
>   (stencil
> (if (markup? arg)
> (interpret-markup layout props arg)
> empty-stencil)))
> 
> (ly:stencil-outline
>   (ly:stencil-scale
> (ly:stencil-rotate
>   (ly:stencil-scale
> (ly:stencil-rotate
>   (ly:stencil-outline stencil point-stencil)
>   45 0 0)
>1
>(* (tan alpha-rad)))
>  (* (- alpha-deg)) 0 0)
>(* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad)))
>  stencil)))
> 
> \markup
>   \override #'(font-name . "Escolar2")
>   \line {
>   problem‘s’s
> \override #'(slant-angle . 18)
> \slanted
> { problem‘s’s }
>   }
> 

Awesome! Thanks a lot. 

I get an error in your code for "slanting" the font:

Parsing...letras.ly:18:5:
In expression (ly:stencil-outline (ly:stencil-scale # # ...) stencil):
letras.ly:18:5: Unbound variable: ly:stencil-outline 

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Malte Meyn



Am 03.04.2018 um 17:30 schrieb Walter Garcia-Fontes:

* Abraham Lee, tisimst.lilyp...@gmail.com [03/04/18 17:23]:

Hi, Walter!
I took at a look at the internals of the font and you're not seeing
anything unintended (unfortunately). The single ASCII apostrophe is set
abnormally low compared to most any other font out there, which is why it
looks vertically offset by LilyPond. In LibreOffice and other
word-processors, when the user hits the button on the keyboard for the
ASCII apostrophe (same goes for quotation marks), the ASCII character gets
replaced by the true (curly) typographic apostrophe, which is set in the
more appropriate vertical position. Could be just an oversight or it could
be intentional. I'm not sure, but from what I am seeing, it's a "feature"
of the font and nothing that LilyPond is doing wrong. The obvious
alternative is to use typographic aposotrophes/quotation marks in your
source file and the problem should go away, appearing just like in
LibreOffice.


Thanks a lot!, that's very clear.

Just a question, sorry if it is obvious, what do you mean by
"typographic apostrophes/quotation marks"?



ASCII: He said "I'd call it 'clear'."
That’s the forms used on typewriters which were included in the ASCII 
standard and found on most keyboards.


typographic: He said “I’d call it ‘clear’.”
That’s the forms used in books which are not part of ASCII but of 
Unicode and cannot be input on many keyboards; therefore some programs 
like Microsoft Office and OpenOffice/LibreOffice replace the ASCII forms 
by these.


Different languages use different typographic forms:

German style: Er sagte „Ich würd’s ‚klar‘ nennen.“
German style in some books: Er sagte »Ich würd’s ›klar‹ nennen.«

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Thomas Morley
2018-04-03 17:30 GMT+02:00 Walter Garcia-Fontes :
> * Abraham Lee, tisimst.lilyp...@gmail.com [03/04/18 17:23]:
>> Hi, Walter!
>> I took at a look at the internals of the font and you're not seeing
>> anything unintended (unfortunately). The single ASCII apostrophe is set
>> abnormally low compared to most any other font out there, which is why it
>> looks vertically offset by LilyPond. In LibreOffice and other
>> word-processors, when the user hits the button on the keyboard for the
>> ASCII apostrophe (same goes for quotation marks), the ASCII character gets
>> replaced by the true (curly) typographic apostrophe, which is set in the
>> more appropriate vertical position. Could be just an oversight or it could
>> be intentional. I'm not sure, but from what I am seeing, it's a "feature"
>> of the font and nothing that LilyPond is doing wrong. The obvious
>> alternative is to use typographic aposotrophes/quotation marks in your
>> source file and the problem should go away, appearing just like in
>> LibreOffice.
>
> Thanks a lot!, that's very clear.
>
> Just a question, sorry if it is obvious, what do you mean by
> "typographic apostrophes/quotation marks"?
>
> --
> Walter Garcia-Fontes
> L'Hospitalet de Llobregat



Probably:  ‘ or ’

As for italic you may try Torsten's markup-command `slanted' from:
http://lilypond.1069038.n5.nabble.com/How-to-prevent-ly-stencil-rotate-to-modify-dimensions-tt210800.html

Leading to:

#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 12))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)
  (alpha-deg (* (/ 180 PI) alpha-rad))
  (stencil
(if (markup? arg)
(interpret-markup layout props arg)
empty-stencil)))

(ly:stencil-outline
  (ly:stencil-scale
(ly:stencil-rotate
  (ly:stencil-scale
(ly:stencil-rotate
  (ly:stencil-outline stencil point-stencil)
  45 0 0)
   1
   (* (tan alpha-rad)))
 (* (- alpha-deg)) 0 0)
   (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad)))
 stencil)))

\markup
  \override #'(font-name . "Escolar2")
  \line {
  problem‘s’s
\override #'(slant-angle . 18)
\slanted
{ problem‘s’s }
  }



Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Walter Garcia-Fontes
* Abraham Lee, tisimst.lilyp...@gmail.com [03/04/18 17:23]:
> Hi, Walter!
> I took at a look at the internals of the font and you're not seeing
> anything unintended (unfortunately). The single ASCII apostrophe is set
> abnormally low compared to most any other font out there, which is why it
> looks vertically offset by LilyPond. In LibreOffice and other
> word-processors, when the user hits the button on the keyboard for the
> ASCII apostrophe (same goes for quotation marks), the ASCII character gets
> replaced by the true (curly) typographic apostrophe, which is set in the
> more appropriate vertical position. Could be just an oversight or it could
> be intentional. I'm not sure, but from what I am seeing, it's a "feature"
> of the font and nothing that LilyPond is doing wrong. The obvious
> alternative is to use typographic aposotrophes/quotation marks in your
> source file and the problem should go away, appearing just like in
> LibreOffice.

Thanks a lot!, that's very clear.

Just a question, sorry if it is obvious, what do you mean by
"typographic apostrophes/quotation marks"? 

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Abraham Lee
Hi, Walter!

On Tue, Apr 3, 2018 at 8:55 AM, Walter Garcia-Fontes 
wrote:

> * Thomas Morley, thomasmorle...@gmail.com [03/04/18 16:50]:
> > Thanks, works now, although it was a little more difficult to install
> > than usual, for unknown reason.
> > I'm not an expert for fonts, so all I say here is by hearsay or simply
> guessing.
> >
> > That said, regarding the images you provided the printed '-sign is not
> > the same in LilyPond and in LibreOffice.
> > I seem to remember somebody explained that text-typesetting programs
> > sometimes use a similiar font if a sign is not available.
> >
> > Similar for bold, italic, bold-italic: if the font doesn't contain
> > them the program scales it.
> >
> > In LibreOffice doing bold and font-size 60 prints ugly as well with
> Escolar2.
> >
> > So I think the font itself is buggy.
>
> Yes, that is what I'm also suspecting, but in any case in LibreOffice
> the font gives less problems than in Lilypond. Most likely LO has more
> features to deal with this type of fonts, being a word-processing
> package.
>
> Too bad I can't convince my costumer to use something else, let's see
> what I can do.
>

I took at a look at the internals of the font and you're not seeing
anything unintended (unfortunately). The single ASCII apostrophe is set
abnormally low compared to most any other font out there, which is why it
looks vertically offset by LilyPond. In LibreOffice and other
word-processors, when the user hits the button on the keyboard for the
ASCII apostrophe (same goes for quotation marks), the ASCII character gets
replaced by the true (curly) typographic apostrophe, which is set in the
more appropriate vertical position. Could be just an oversight or it could
be intentional. I'm not sure, but from what I am seeing, it's a "feature"
of the font and nothing that LilyPond is doing wrong. The obvious
alternative is to use typographic aposotrophes/quotation marks in your
source file and the problem should go away, appearing just like in
LibreOffice.

Hope that helps,
Abraham
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Walter Garcia-Fontes
* Thomas Morley, thomasmorle...@gmail.com [03/04/18 16:50]:
> Thanks, works now, although it was a little more difficult to install
> than usual, for unknown reason.
> I'm not an expert for fonts, so all I say here is by hearsay or simply 
> guessing.
> 
> That said, regarding the images you provided the printed '-sign is not
> the same in LilyPond and in LibreOffice.
> I seem to remember somebody explained that text-typesetting programs
> sometimes use a similiar font if a sign is not available.
> 
> Similar for bold, italic, bold-italic: if the font doesn't contain
> them the program scales it.
> 
> In LibreOffice doing bold and font-size 60 prints ugly as well with Escolar2.
> 
> So I think the font itself is buggy.

Yes, that is what I'm also suspecting, but in any case in LibreOffice
the font gives less problems than in Lilypond. Most likely LO has more
features to deal with this type of fonts, being a word-processing
package. 

Too bad I can't convince my costumer to use something else, let's see
what I can do.

Thanks for the answer,

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Thomas Morley
2018-04-03 15:51 GMT+02:00 Walter Garcia-Fontes :
> * Thomas Morley, thomasmorle...@gmail.com [03/04/18 15:44]:
>> Hi,
>>
>> 2018-04-02 20:10 GMT+02:00 Walter Garcia-Fontes :
>> > I have a problem using this font:
>> >
>> > http://puna.upf.edu/Escolar_N.ttf
>>
>> this link is dead...
>
> Sorry, it is:
>
> http://puna.upf.edu/Escolar_N.TTF
>
> --
> Walter Garcia-Fontes
> L'Hospitalet de Llobregat



Thanks, works now, although it was a little more difficult to install
than usual, for unknown reason.
I'm not an expert for fonts, so all I say here is by hearsay or simply guessing.

That said, regarding the images you provided the printed '-sign is not
the same in LilyPond and in LibreOffice.
I seem to remember somebody explained that text-typesetting programs
sometimes use a similiar font if a sign is not available.

Similar for bold, italic, bold-italic: if the font doesn't contain
them the program scales it.

In LibreOffice doing bold and font-size 60 prints ugly as well with Escolar2.

So I think the font itself is buggy.



Sorry to be of not more help,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Walter Garcia-Fontes
* Thomas Morley, thomasmorle...@gmail.com [03/04/18 15:44]:
> Hi,
> 
> 2018-04-02 20:10 GMT+02:00 Walter Garcia-Fontes :
> > I have a problem using this font:
> >
> > http://puna.upf.edu/Escolar_N.ttf
> 
> this link is dead...

Sorry, it is:

http://puna.upf.edu/Escolar_N.TTF

-- 
Walter Garcia-Fontes
L'Hospitalet de Llobregat


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problem with a font

2018-04-03 Thread Thomas Morley
Hi,

2018-04-02 20:10 GMT+02:00 Walter Garcia-Fontes :
> I have a problem using this font:
>
> http://puna.upf.edu/Escolar_N.ttf

this link is dead...


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Problem with a font

2018-04-02 Thread Walter Garcia-Fontes
I have a problem using this font:

http://puna.upf.edu/Escolar_N.ttf

For instance:

\version "2.18.2"

\paper {
   #(define fonts
  (make-pango-font-tree
   "Escolar2"
   "Escolar2"
   "Escolar2"
   (/ staff-height pt 20)))
}

\markup{This is showing the problem '}

The apostrophe is printed too low. This is what
I get:

http://puna.upf.edu/letras.pdf

If I use this same font in, say, LibreOffice Writer, I
get the apostrophe as it should be. Here is a
screenshot:

http://puna.upf.edu/writer.png

I'd like to understand why LilyPond is not able
to render this font as Writer, and if there is anything
I can do to solve it. In Writer, there is
also the possibility of having Bold, Italic and
Italic-Bold with this single font file, but in Lilypond
this is not possible.

Walter

--
Walter Garcia-Fontes
L'Hospitalet de Llobregat

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user