Re: \center-column broken

2021-02-16 Thread Werner LEMBERG

> Inkscape works very well to convert PDFs to SVG, but if we expect
> our users to do that, then it's debatable whether we should have an
> SVG backend at all.

I agree.  However, my SVG knowledge is very small; this means I'm not
qualified to make any decisions.

> (I mean this seriously: the SVG backend has its own bugs that are
> hard to fix; we have no way, currently, to regtest it; and we could
> get LilyPond to call inkscape itself where it is available and SVG
> is the specified backend; just a thought...)

Please raise these topics on the 'lilypond-devel' mailing list!
'bug-lilypond' is probably the wrong one.

It probably also makes sense to file issues in the tracker.


Werner

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


Re: \center-column broken

2021-02-16 Thread Kevin Barry
On Tue, 16 Feb 2021 at 08:44, Werner LEMBERG  wrote:
>
>
> > How about hosting the fonts on www.lilypond.org and referencing them
> > in the @font-face definition?
>
> I think this is not a good idea.

I agree that hosting fonts would be a headache: everyone's svg
documents would suddenly depend on lilypond.org.

I am sympathetic to the idea that we should embed the fonts in the
SVG, or perhaps provide a command-line option to tell LilyPond to do
so. Inkscape works very well to convert PDFs to SVG, but if we expect
our users to do that, then it's debatable whether we should have an
SVG backend at all. (I mean this seriously: the SVG backend has its
own bugs that are hard to fix; we have no way, currently, to regtest
it; and we could get LilyPond to call inkscape itself where it is
available and SVG is the specified backend; just a thought...)

Kevin

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


Re: \center-column broken

2021-02-16 Thread Werner LEMBERG

> How about hosting the fonts on www.lilypond.org and referencing them
> in the @font-face definition?

I think this is not a good idea.

* LilyPond fonts change from version to version, quite often in a
  backwards-incompatible way.  Hosting them for SVG access would
  enforce us to completely revise how fonts are named and accessed –
  and versioned.  To a certain extent this will become better if the
  transition to SMuFL is done, but it still complicates things.

* It would be necessary to serve subsetted fonts, too; otherwise, the
  internet bandwidth would be far too large.  LilyPond has zero
  support for that.

* Contrary to fonts, hinting does not make sense for most musical
  glyphs.  In other words, the benefit of accessing LilyPond graphical
  objects (grobs) as real glyphs in fonts is zero.

* Serving non-musical fonts would be definitely out of scope for
  'lilypond.org'.

What exactly do you want to achieve?  What kind of SVGs do you need?
In previous e-mails I mentioned two solutions how SVGs could be
improved:

* using inkscape's option `-T` to convert glyphs to outlines
* conversion from PDF to SVG with inkscape

Doesn't this suffice?


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


Re: \center-column broken

2021-02-15 Thread Johannes Feulner
How about hosting the fonts on www.lilypond.org and referencing them in 
the @font-face definition?


Johannes

Am 15.02.2021 um 21:06 schrieb Werner LEMBERG:

IMHO, this is as good (or as bad) as a default as 'serif'.  If you
want SVG images to be similar to, say, PDF output, you have

* to exactly specify which font you want to use for text, and
* to convert glyphs to paths, for example, by postprocessing
  LilyPond's output SVG file with inkscape's `-T` option.

Could we possibly offer the option to embed the fonts inside of the
SVG file [...]

This is a non-trivial issue.  It's rather straightforward to embed
fonts into an SVG file using

   
 @font-face {
   font-family: 'foobar';
   src: url(data: application/font-woff2;
charset = utf-8;
base64, d09GMgABAA70AA8AGF ...)
format('woff2'),
   font-weight: normal;
   font-style: normal;
 }
   

The tricky part, however, is font subsetting to make the SVG files
small.  IMHO, this is outside of LilyPond's scope.

Another possibility is creating a PDF with LilyPond, then loading it
into inkscape, which can automatically convert all fonts to paths.
This way, you get SVGs that are identical to the PDFs – I think this
is good enough for having scalable images on web pages and the like.


 Werner



--
Johannes Feulner
Tel: +49 721 33500158  johannes.feul...@scorio.com

scorio GmbH  Bonhoefferweg 3   76327 Pfinztal
Geschäftsführer Johannes Feulner
Sitz der Gesellschaft Karlsruhe
Amtsgericht Mannheim HRB 713486


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


Re: \center-column broken

2021-02-15 Thread Werner LEMBERG

>> IMHO, this is as good (or as bad) as a default as 'serif'.  If you
>> want SVG images to be similar to, say, PDF output, you have
>>
>>* to exactly specify which font you want to use for text, and
>>* to convert glyphs to paths, for example, by postprocessing
>>  LilyPond's output SVG file with inkscape's `-T` option.
> 
> Could we possibly offer the option to embed the fonts inside of the
> SVG file [...]

This is a non-trivial issue.  It's rather straightforward to embed
fonts into an SVG file using

  
@font-face {
  font-family: 'foobar';
  src: url(data: application/font-woff2;
   charset = utf-8;
   base64, d09GMgABAA70AA8AGF ...)
   format('woff2'),
  font-weight: normal;
  font-style: normal;
}
  

The tricky part, however, is font subsetting to make the SVG files
small.  IMHO, this is outside of LilyPond's scope.

Another possibility is creating a PDF with LilyPond, then loading it
into inkscape, which can automatically convert all fonts to paths.
This way, you get SVGs that are identical to the PDFs – I think this
is good enough for having scalable images on web pages and the like.


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


Re: \center-column broken

2021-02-15 Thread Johannes Feulner
Upvoted. Maybe it should even be the default to embed the fonts (and 
only those) that are actually used in the SVG with an option to turn 
that feature off.


Johannes

Am 14.02.2021 um 20:30 schrieb Jean Abou Samra:

Could we possibly offer the option to embed the
fonts inside of the SVG file or is this nonsense?

Jean

Le 14/02/2021 à 19:48, Werner LEMBERG a écrit :


With 2.18, I see this instead:






IMHO, this is as good (or as bad) as a default as 'serif'.  If you
want SVG images to be similar to, say, PDF output, you have

   * to exactly specify which font you want to use for text, and
   * to convert glyphs to paths, for example, by postprocessing
 LilyPond's output SVG file with inkscape's `-T` option.


  Werner




--
Johannes Feulner
Tel: +49 721 33500158  johannes.feul...@scorio.com

scorio GmbH  Bonhoefferweg 3   76327 Pfinztal
Geschäftsführer Johannes Feulner
Sitz der Gesellschaft Karlsruhe
Amtsgericht Mannheim HRB 713486


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


Re: \center-column broken

2021-02-14 Thread Jean Abou Samra

Le 14/02/2021 à 19:48, Werner LEMBERG a écrit :


With 2.18, I see this instead:






IMHO, this is as good (or as bad) as a default as 'serif'.  If you
want SVG images to be similar to, say, PDF output, you have

   * to exactly specify which font you want to use for text, and
   * to convert glyphs to paths, for example, by postprocessing
 LilyPond's output SVG file with inkscape's `-T` option.


  Werner



Could we possibly offer the option to embed the
fonts inside of the SVG file or is this nonsense?

Jean


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


Re: \center-column broken

2021-02-14 Thread Werner LEMBERG

> But what is the difference between _\markup and -\markup?

Alas, this is missing in the notation index.[*]

In general, if you use `-` before an object (attached to a note),
LilyPond uses a vertical default position.  If you use `^` or `_`
instead, the object's vertical position is forced to be above or
below, respectively.


Werner


[*] To be added with merge request #651

  https://gitlab.com/lilypond/lilypond/-/merge_requests/651

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


Re: \center-column broken

2021-02-14 Thread David Kastrup
Johannes Feulner  writes:

> But what is the difference between _\markup and -\markup?
>
> Looking at the examples on
> http://lilypond.org/doc/v2.22/Documentation/notation/formatting-text I
> cannot see a difference.

_\markup is essentially the same as

-\withMusicProperty #'direction #DOWN -\markup

It won't make a difference for text scripts that are going to appear
below the system anyway.  But for example in \voiceOne settings, they'd
go above the system by default.

-- 
David Kastrup

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


Re: \center-column broken

2021-02-14 Thread Werner LEMBERG

> With 2.18, I see this instead:
> 
>    font-family="Century Schoolbook L"
>   font-weight="bold"
>   font-size="6.9848"
>   text-anchor="start"
>   fill="currentColor">
> 
> 
> 

IMHO, this is as good (or as bad) as a default as 'serif'.  If you
want SVG images to be similar to, say, PDF output, you have

  * to exactly specify which font you want to use for text, and
  * to convert glyphs to paths, for example, by postprocessing
LilyPond's output SVG file with inkscape's `-T` option.


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


Re: \center-column broken

2021-02-14 Thread Jonas Hahnfeld via bug-lilypond
Am Sonntag, dem 14.02.2021 um 18:25 +0100 schrieb Jean Abou Samra:
> Hello,
> 
> Le 14/02/2021 à 16:59, Johannes Feulner a écrit :
> > Hi Aron,
> > 
> > the \center-column issue seems to be a problem of the SVG backend. I 
> > compiled LilyPond from master and use a custom backend based on 
> > LilyPond's SVG backend. However, the pictures were made with 
> > LilyPond's standard SVG backend. I've now used the PDF backend,  it is 
> > not affected.
> 
> 
> I am not competent about this. However, I can notice
> that with fresh a build of master, in SVG backend,
> Eye of Gnome displays the file incorrectly; the text
> runs off the box as you describe. The tagline is also
> sloppy. With Firefox, all is fine. With both readers,
> the font used does not resemble LilyPond's default.
> With 2.18, Firefox displays the file correctly with
> LilyPond's default font, and Eye of Gnome does not
> manage to render the text at all (it replaces it
> with ellipsis).
> 
> Attached are screenshots.
> 
> I see that all that ends up in this SVG file is
> (manually wrapped):
> 
>     font-weight="bold"
>    font-size="6.9848"
>    text-anchor="start"
>    fill="currentColor">
> 
> 
> 
> so the reader is apparently free to render this text
> with whatever serif font it prefers.
> 
> With 2.18, I see this instead:
> 
>     font-family="Century Schoolbook L"
>    font-weight="bold"
>    font-size="6.9848"
>    text-anchor="start"
>    fill="currentColor">
> 
> 
> 
> 
> There appears to be a real change in behavior
> between versions 2.19.21 and 2.19.22. Outstanding
> commits regarding fonts are:

I think it's the interaction of

> commit 28f58ecc2271956e9377dc61e5135ce3ade4abbd
> Author: Masamichi Hosoda 
> Date:   Fri Jun 12 17:17:56 2015 +0900
> 
>  Issue 4441 / 4: Define default fonts in fontconfig configuration file
> 
>  This commit defines LilyPond default fonts
>  in local fontconfig configuration file.
>  And, LilyPond uses them.
> 
>  It is possible to combine multiple fonts
>  with different character sets and glyphs each other.
> 
>  e.g. Following fonts can be combined.
>  Latin glyphs: from a font without Cyrillic glyphs
>  Cyrillic glyphs: from another font with Cyrillic glyphs

and

commit ead2001959fa5bda0338e92a0f301fd1f26ad768
Author: Paul Morris 
Date:   Sat Feb 20 11:24:04 2016 -0500

Issue 4776/1 font.scm: better svg defaults for font-family

if the user has not set the font, use a
meaningful svg default ('serif' 'sans-serif'
or 'monospace') for the font-family property

After reading
https://lists.gnu.org/archive/html/bug-lilypond/2016-02/msg00079.html
my understanding is that SVG renderers don't understand the alias
"LilyPond Serif" (how would they?) and it was decided to use the
generic "serif" instead. It would probably be more correct to specify
the font that was used to calculate the layout, but then it might be
that it's not installed on the viewer's system (when distributing the
SVG) and the user would still see garbage...

Jonas


signature.asc
Description: This is a digitally signed message part
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: \center-column broken

2021-02-14 Thread Jean Abou Samra

Hello,

Le 14/02/2021 à 16:59, Johannes Feulner a écrit :

Hi Aron,

the \center-column issue seems to be a problem of the SVG backend. I 
compiled LilyPond from master and use a custom backend based on 
LilyPond's SVG backend. However, the pictures were made with 
LilyPond's standard SVG backend. I've now used the PDF backend,  it is 
not affected.



I am not competent about this. However, I can notice
that with fresh a build of master, in SVG backend,
Eye of Gnome displays the file incorrectly; the text
runs off the box as you describe. The tagline is also
sloppy. With Firefox, all is fine. With both readers,
the font used does not resemble LilyPond's default.
With 2.18, Firefox displays the file correctly with
LilyPond's default font, and Eye of Gnome does not
manage to render the text at all (it replaces it
with ellipsis).

Attached are screenshots.

I see that all that ends up in this SVG file is
(manually wrapped):





so the reader is apparently free to render this text
with whatever serif font it prefers.

With 2.18, I see this instead:






There appears to be a real change in behavior
between versions 2.19.21 and 2.19.22. Outstanding
commits regarding fonts are:

commit 3527336fc0bbb7c00f1d040420d4f2b1df8a3c38
Author: Masamichi Hosoda 
Date:   Fri Jun 12 17:24:07 2015 +0900

    Issue 4441 / 5: Reject bitmap fonts in lilypond-fonts.conf

    LilyPond can not use bitmap fonts.
    So this commit adds ``reject bitmap fonts''
    from fontconfig's ``70-no-bitmaps.conf''
    to lilypond-fonts.conf.

commit 28f58ecc2271956e9377dc61e5135ce3ade4abbd
Author: Masamichi Hosoda 
Date:   Fri Jun 12 17:17:56 2015 +0900

    Issue 4441 / 4: Define default fonts in fontconfig configuration file

    This commit defines LilyPond default fonts
    in local fontconfig configuration file.
    And, LilyPond uses them.

    It is possible to combine multiple fonts
    with different character sets and glyphs each other.

    e.g. Following fonts can be combined.
    Latin glyphs: from a font without Cyrillic glyphs
    Cyrillic glyphs: from another font with Cyrillic glyphs

commit 0c3ccff5943a1b5cfea65f695b87a8d2262e0f97
Author: Masamichi Hosoda 
Date:   Fri Jun 12 16:29:54 2015 +0900

    Issue 4441 / 3: Add empty lilypond-fonts.conf

    This commit adds
    LilyPond local fontconfig configuration file as empty.

commit 6831c973d078b4e41025c27b725887028aff3e73
Author: Masamichi Hosoda 
Date:   Fri Jun 12 16:23:37 2015 +0900

    Issue 4441 / 2: Add local fontconfig configuration file loading

    This commit becomes that
    LilyPond local (dedicated) fontconfig configuration file
    `fonts/lilypond-fonts.conf' can be used.

commit e3246bd7dd2cb83f203dabcb43b988507ba715a7
Author: Masamichi Hosoda 
Date:   Fri Jun 12 16:12:43 2015 +0900

    Issue 4441 / 1: Remove unnecessary loop

    The font dir that LilyPond adding
    to fontconfig is only one.
    So loop is unnecessary.

Hosoda-san, was this change intended?


Thanks for the "-\tweak parent-alignment-X #CENTER" hint. Works 
nicely. Shouldn't that be the default value?



I don't think so. To my eyes,

\version "2.23.1"

{
  c'^"Dal segno"
}

looks better than

{
  c'\tweak parent-alignment-X #CENTER ^"Dal segno"
}



Le 14/02/2021 à 17:49, Johannes Feulner a écrit :

But what is the difference between _\markup and -\markup?

Looking at the examples on 
http://lilypond.org/doc/v2.22/Documentation/notation/formatting-text 
I cannot see a difference.




With the - specifier, the direction is chosen
automatically. See:

http://lilypond.org/doc/v2.22/Documentation/notation/direction-and-placement#articulation-direction-indicators


Best regards,
Jean

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


Re: \center-column broken

2021-02-14 Thread Johannes Feulner

But what is the difference between _\markup and -\markup?

Looking at the examples on 
http://lilypond.org/doc/v2.22/Documentation/notation/formatting-text I 
cannot see a difference.


Johannes

The examples on
Am 14.02.2021 um 17:27 schrieb Werner LEMBERG:

I had seen the "-" operator before but could not find it in
LilyPond's docs.

If you look into the index, you can find it in the notation reference
(NR):

   
http://lilypond.org/doc/v2.23/Documentation/notation/expressive-marks-attached-to-notes#index-_002d


  Werner



--
Johannes Feulner
Tel: +49 721 33500158  johannes.feul...@scorio.com

scorio GmbH  Bonhoefferweg 3   76327 Pfinztal
Geschäftsführer Johannes Feulner
Sitz der Gesellschaft Karlsruhe
Amtsgericht Mannheim HRB 713486


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


Re: \center-column broken

2021-02-14 Thread Johannes Feulner

Thanks,

and on 
http://lilypond.org/doc/v2.22/Documentation/notation/the-tweak-command 
the -\tweak is well documented.


Johannes

Am 14.02.2021 um 17:27 schrieb Werner LEMBERG:

I had seen the "-" operator before but could not find it in
LilyPond's docs.

If you look into the index, you can find it in the notation reference
(NR):

   
http://lilypond.org/doc/v2.23/Documentation/notation/expressive-marks-attached-to-notes#index-_002d


  Werner



--
Johannes Feulner
Tel: +49 721 33500158  johannes.feul...@scorio.com

scorio GmbH  Bonhoefferweg 3   76327 Pfinztal
Geschäftsführer Johannes Feulner
Sitz der Gesellschaft Karlsruhe
Amtsgericht Mannheim HRB 713486


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


Re: \center-column broken

2021-02-14 Thread Werner LEMBERG

> I had seen the "-" operator before but could not find it in
> LilyPond's docs.

If you look into the index, you can find it in the notation reference
(NR):

  
http://lilypond.org/doc/v2.23/Documentation/notation/expressive-marks-attached-to-notes#index-_002d


 Werner

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


Re: \center-column broken

2021-02-14 Thread Johannes Feulner

Hi Aron,

the \center-column issue seems to be a problem of the SVG backend. I 
compiled LilyPond from master and use a custom backend based on 
LilyPond's SVG backend. However, the pictures were made with LilyPond's 
standard SVG backend. I've now used the PDF backend,  it is not affected.


Thanks for the "-\tweak parent-alignment-X #CENTER" hint. Works nicely. 
Shouldn't that be the default value?


I had seen the "-" operator before but could not find it in LilyPond's 
docs. Could you please tell me ho it works?


Cheers,

Johannes

Am 14.02.2021 um 16:36 schrieb Aaron Hill:

On 2021-02-14 7:08 am, Johannes Feulner wrote:

Hi there,

\center-column is broken. In 2.18 it was still OK. The lines of a
\center-column are supposed to be centered under each other. This is
at least with 2.23.1 not any longer the case. Please, see attached
pictures. The "" is clearly not centered unter the "|".

   \version "2.18.0"

   { a'1 a'1
      c'' ^\markup
     \center-align \box \bold \fontsize #10 \center-column { "|" ""
   "bbb" "|" }
   }



For reference, I see the correct behavior with 2.22.0 and 2.23.0, 
testing with both PDF and cropped PNG output.  (Latest on lilypond.org 
is 2.23.0-1, so are you compiling something yourself?)


Ultimately, this is a bug with how the glyphs are being rendered, not 
one related to centering.  Specifically, the wrong font is being 
rendered compared to the one that determined the physical extent.  If 
the narrower-looking letters had been intended, \box would have been 
much tighter around the markup.  This looks like an issue you would 
get with poor font substitution, so are you able to rule out issues 
with your PDF viewer and environment?




Another problem is with \center-align. \center-align centers its
contents (here the box) over the left edge of the note it is attached
to. This does not look very centered at all. It should be centered
over the middle of the note's x-extent. This was already wrong in
2.18.


You need to adjust parent-alignment-X as desired:


\version "2.22.0"

{ a'1 a'1
  c'' -\tweak parent-alignment-X #CENTER
  ^\markup \center-align \box \bold \fontsize #10
   \center-column { "|" "" "bbb" "|" } }



-- Aaron Hill



--
Johannes Feulner
Tel: +49 721 33500158  johannes.feul...@scorio.com

scorio GmbH  Bonhoefferweg 3   76327 Pfinztal
Geschäftsführer Johannes Feulner
Sitz der Gesellschaft Karlsruhe
Amtsgericht Mannheim HRB 713486


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


Re: \center-column broken

2021-02-14 Thread Aaron Hill

On 2021-02-14 7:08 am, Johannes Feulner wrote:

Hi there,

\center-column is broken. In 2.18 it was still OK. The lines of a
\center-column are supposed to be centered under each other. This is
at least with 2.23.1 not any longer the case. Please, see attached
pictures. The "" is clearly not centered unter the "|".

   \version "2.18.0"

   { a'1 a'1
  c'' ^\markup
 \center-align \box \bold \fontsize #10 \center-column { "|" ""
   "bbb" "|" }
   }



For reference, I see the correct behavior with 2.22.0 and 2.23.0, 
testing with both PDF and cropped PNG output.  (Latest on lilypond.org 
is 2.23.0-1, so are you compiling something yourself?)


Ultimately, this is a bug with how the glyphs are being rendered, not 
one related to centering.  Specifically, the wrong font is being 
rendered compared to the one that determined the physical extent.  If 
the narrower-looking letters had been intended, \box would have been 
much tighter around the markup.  This looks like an issue you would get 
with poor font substitution, so are you able to rule out issues with 
your PDF viewer and environment?




Another problem is with \center-align. \center-align centers its
contents (here the box) over the left edge of the note it is attached
to. This does not look very centered at all. It should be centered
over the middle of the note's x-extent. This was already wrong in
2.18.


You need to adjust parent-alignment-X as desired:


\version "2.22.0"

{ a'1 a'1
  c'' -\tweak parent-alignment-X #CENTER
  ^\markup \center-align \box \bold \fontsize #10
   \center-column { "|" "" "bbb" "|" } }



-- Aaron Hill

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