Hi,
in Debian we're currently moving to enable the maintainer mode to e.g. rebuild Wine's TrueType fonts. AJ already warned us that this is risky:
On 04/01/2016 04:54 AM, wine-bugs@winehq.org wrote:
https://bugs.winehq.org/show_bug.cgi?id=40391
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- There is definitely a risk too, particularly for fonts. They are supposed to be built with our forked version of fontforge (https://source.winehq.org/git/fontforge.git), that contains a couple of fixes compared to the upstream version.
I really appreciate that warning, thanks again! See a "short" explanation at the end of the mail, why we want to do this anyway.
I'd like to figure out how to improve the resulting situation by getting the Wine changes to fontforge applied upstream (and/or in Debian). With "upstream" I mean github.com/fontforge. I will contact them in a later step.
Wine and Debian are both using the quite old fontforge version 20120731-b, the patches apply cleanly in Debian. But upstream is actively developing and in Debian someone is working on packaging a recent version (not sure with what outcome, e.g. afaik there is at least one upstream regression blocking an update). Are there any plans in Wine to update to a newer version?
Wine's fontforge has 4 changes. I recreated them based on AJ's merge for 20120731-b and by myself for 20160404 to get a *rough* picture of their current state (not tested and I'm absolutely no expert in this):
1. Various hacks to avoid putting timestamps in generated files (AJ).
No relevant changes upstream, but there is some work going to allow one to specify the timestamp in order to get the build deterministic/reproducible. Would this make this patch obsolete?
I don't know why upstream wants timestamps at all, nor what problems these cause for Wine. Is this Wine specific, or would it make sense to drop timestamping upstream, too?
2. - Avoid outputting trailing spaces in sfd files (AJ).
About a third seems to be applied in 20160404. I assume the rest would still be relevant if Wine updated its fontforge version.
Is this patch only relevant for creating fonts/glyphs, but not for building the TrueType fonts? Looks like a good candidate for forwarding to upstream.
3. Enable the width of individual bitmap strikes to be altered (Huw Davies).
Since the import of upstream version 20120731-b this patch only has a third of its original size. Are the remaining Wine changes still necessary, or are they cruft? If still needed, I guess they should be pushed upstream.
In 20160404 not much seems to have changed, but the containing file bitmapview.c was moved ("splitting ui code from fontforge/ to fontforgeexe/").
Same as above: is this only needed when creating fonts? Looks like a candidate for upstream.
4. Don't save the selected state. (Huw Davies)
I found no relevant changes upstream. No idea about this.
Why are we doing this? ---------------------- The Debian Free Software Guidelines [DFSG] (which are the fundamental basis for the Debian project) mandate that binaries must be accompanied by their source (which is usually ensured by building from source), and that you must be able to modify and redistribute the package with only the software available in Debian. The reasons for these are e.g. philosophical (empowering the user), QA (rebuilding if there was an issue in the build tools), reproducibility (recreate byte-by-byte-identically, e.g. to rule out attacks at a build machine or do QA) or security (a build from correct source code may be manipulated by specific compilers). The TrueType fonts are pre-built with a forked fontforge, which isn't (and very unlikely will ever be) in Debian. To package the pre-built fonts imo we would have to remove Wine from official Debian (main), and move it to the non/semi-official contrib section. For the same reason (AFAIK, I'm not the author of these changes) we're also regenerating opengl files, request code and unicode. This problem was ignored/missed in the past for the Debian Wine packages, yet this is no argument against fixing them now. We definitely don't want Wine removed from Debian, instead keep it in and get it there as good as possible.
btw, we're also adding a patch (based on wine staging) to append '(Debian)' to the version string now.
btw2, can you recommend some alternative free fonts to install (either as partial replacement or as extension to the Wine fonts)?
Greets, and thanks in advance jre
[DFSG] https://www.debian.org/doc/debian-policy/ch-archive.html#s-dfsg, see also the following chapter "The main archive area".
Jens Reyer jre.winesim@gmail.com writes:
Wine and Debian are both using the quite old fontforge version 20120731-b, the patches apply cleanly in Debian. But upstream is actively developing and in Debian someone is working on packaging a recent version (not sure with what outcome, e.g. afaik there is at least one upstream regression blocking an update). Are there any plans in Wine to update to a newer version?
No plans currently, but I can certainly look into it if it helps.
- Various hacks to avoid putting timestamps in generated files (AJ).
No relevant changes upstream, but there is some work going to allow one to specify the timestamp in order to get the build deterministic/reproducible. Would this make this patch obsolete?
I don't know why upstream wants timestamps at all, nor what problems these cause for Wine. Is this Wine specific, or would it make sense to drop timestamping upstream, too?
I don't know why they'd want timestamps either; an option to set the timestamp could certainly work, though getting rid of them would be even better IMO. It's needed in Wine because the files are in git (to avoid requiring fontforge at build time), and I don't want spurious diffs every time I run make.
- Avoid outputting trailing spaces in sfd files (AJ).
About a third seems to be applied in 20160404. I assume the rest would still be relevant if Wine updated its fontforge version.
Is this patch only relevant for creating fonts/glyphs, but not for building the TrueType fonts? Looks like a good candidate for forwarding to upstream.
Same here, it's to avoid spurious diffs, especially since git will then remove the spaces again when applying patches etc. It should make no difference when building the ttf files.
- Enable the width of individual bitmap strikes to be altered (Huw Davies).
Since the import of upstream version 20120731-b this patch only has a third of its original size. Are the remaining Wine changes still necessary, or are they cruft? If still needed, I guess they should be pushed upstream.
In 20160404 not much seems to have changed, but the containing file bitmapview.c was moved ("splitting ui code from fontforge/ to fontforgeexe/").
Same as above: is this only needed when creating fonts? Looks like a candidate for upstream.
I believe it's still needed, I'm not sure why that part didn't get upstream.
- Don't save the selected state. (Huw Davies)
I found no relevant changes upstream. No idea about this.
I believe this is also to avoid diffs when working on the files.
There are other things like the fontforge window size that are saved in the sfd files. Currently I remove them from the diff manually, but it would certainly be nice to fix that upstream too.
[CC to Huw Davies because I have a question about one of his changes]
On 04/22/2016 12:54 PM, Alexandre Julliard wrote:
Jens Reyer jre.winesim@gmail.com writes:
Wine and Debian are both using the quite old fontforge version 20120731-b, the patches apply cleanly in Debian. But upstream is actively developing and in Debian someone is working on packaging a recent version (not sure with what outcome, e.g. afaik there is at least one upstream regression blocking an update). Are there any plans in Wine to update to a newer version?
No plans currently, but I can certainly look into it if it helps.
Thanks. First off, I successfully tested the current fontforge 20160404. I built Wine and the .ttf files with it, and verified in one app that relies on them that they are working. So no immediate need to update, but it might be a good idea generally.
After looking into your patches and explanation my understanding is that we may regenerate the .ttf files in Debian without having to worry about the results. However for contributing to Wine the current Debian fontforge is not suitable. So I started trying to get your changes applied upstream:
- Various hacks to avoid putting timestamps in generated files (AJ).
Created issue https://github.com/fontforge/fontforge/issues/2711 The timestamps are also a hindrance for reproducible builds, and need to be tackled somehow in fontforge anyway.
- Avoid outputting trailing spaces in sfd files (AJ).
Created pull request https://github.com/fontforge/fontforge/pull/2713 for hopefully all remaining changes.
- Enable the width of individual bitmap strikes to be altered (Huw Davies).
Since the import of upstream version 20120731-b this patch only has a third of its original size. Are the remaining Wine changes still necessary, or are they cruft? If still needed, I guess they should be pushed upstream.
In 20160404 not much seems to have changed, but the containing file bitmapview.c was moved ("splitting ui code from fontforge/ to fontforgeexe/").
Same as above: is this only needed when creating fonts? Looks like a candidate for upstream.
I believe it's still needed, I'm not sure why that part didn't get upstream.
See below for the remaining changes. I didn't bring that to upstream, because I don't know how to test this. Instructions, or a review of the patch and whether its still needed in 20160404, would be welcome. Alternatively, if you update to a newer fontforge I'd filter out the remaining diff and just go with that.
- Don't save the selected state. (Huw Davies)
Created issue https://github.com/fontforge/fontforge/issues/2715 for this and other local information saved in sfds.
Greets jre
--- fontforgeexe/bitmapview.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fontforgeexe/bitmapview.c b/fontforgeexe/bitmapview.c index 7cee735..749123d 100644 --- a/fontforgeexe/bitmapview.c +++ b/fontforgeexe/bitmapview.c @@ -1758,8 +1758,6 @@ static void BVMenuSetWidth(GWindow gw,struct gmenuitem *mi,GEvent *g) { SplineChar *sc; int val;
- if ( !bv->bdf->sf->onlybitmaps ) -return; if ( mi->mid==MID_SetWidth ) { sprintf( buffer,"%d",bv->bc->width); ret = gwwv_ask_string(_("Set Width..."),buffer,_("Set Width...")); @@ -1778,6 +1776,10 @@ return; else bv->bc->vwidth = val; BCCharChangedUpdate(bv->bc); + + if ( !bv->bdf->sf->onlybitmaps ) +return; + for ( bdf=bv->bdf->sf->bitmaps; bdf!=NULL; bdf=bdf->next ) if ( bdf->pixelsize > mysize ) return; @@ -2065,10 +2067,10 @@ static void mtlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) { for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) { switch ( mi->mid ) { case MID_SetWidth: - mi->ti.disabled = !bv->bdf->sf->onlybitmaps; + mi->ti.disabled = 0; break; case MID_SetVWidth: - mi->ti.disabled = !bv->bdf->sf->onlybitmaps || !bv->bdf->sf->hasvmetrics; + mi->ti.disabled = !bv->bdf->sf->hasvmetrics; break; } }
On 30.04.2016 04:13, Jens Reyer wrote:
On 04/22/2016 12:54 PM, Alexandre Julliard wrote:
Jens Reyer jre.winesim@gmail.com writes:
Wine and Debian are both using the quite old fontforge version 20120731-b, the patches apply cleanly in Debian. But upstream is actively developing and in Debian someone is working on packaging a recent version (not sure with what outcome, e.g. afaik there is at least one upstream regression blocking an update). Are there any plans in Wine to update to a newer version?
No plans currently, but I can certainly look into it if it helps.
Thanks. First off, I successfully tested the current fontforge 20160404. I built Wine and the .ttf files with it, and verified in one app that relies on them that they are working. So no immediate need to update, but it might be a good idea generally.
After looking into your patches and explanation my understanding is that we may regenerate the .ttf files in Debian without having to worry about the results. However for contributing to Wine the current Debian fontforge is not suitable. So I started trying to get your changes applied upstream:
- Various hacks to avoid putting timestamps in generated files (AJ).
Created issue https://github.com/fontforge/fontforge/issues/2711 The timestamps are also a hindrance for reproducible builds, and need to be tackled somehow in fontforge anyway.
fyi, fontforge upstream is currently discussing this issue.