** Description changed:
libgdiplus' cairo backend only takes the fontconfig *match* to render
glyphs in cairo, with zero considerations for substitutes. This causes
significant problems when a developer using WinForms tries to display
some CJK glyphs in "Sans", while expecting system-like handling for
these bugs. Tofus will show up in such cases if the first candidate
generated from `fc-match Sans` is not a font with CJK glyphs.
- This modified version of WinForms 'hello world' should be able to show
- this bug:
+ This modified version of WinForms 'hello world' should be able to show this
bug when fc-match satisfies the said conditions:
+ (Consider changing "Sans" to non-CJK fonts like "Liberation Sans" for stable
reproduction.)
```C#
using System;
using System.Drawing;
using System.Windows.Forms;
public class HelloWorld : Form
{
static public void Main ()
{
Application.Run (new HelloWorld ());
}
public HelloWorld ()
{
Button b = new Button ();
b.Text = "Tofus? → 我是方框。";
b.Font = new Font("Sans", 11);
b.Click += new EventHandler (Button_Click);
Controls.Add (b);
}
private void Button_Click (object sender, EventArgs e)
{
MessageBox.Show ("Does it taste good?");
}
}
```
Note this problem is not limited to "Sans", nor CJK chars -- I am just
using these for a common-enough example. In real life developers trying
to do cross-platform Winforms development might instead just use the
default fonts ("MS Sans Serif" or "Tahoma" on Mono), and still bump into
the very same blocks of tofu, perhaps with the emojis sent by their
happy users.
A possible workaround is to try the experimental pango backend, but that
is really very experimental. There is a pending PR at
https://github.com/mono/libgdiplus/pull/39, which is said to be
"basically approved" back in 2009. (Yeah, mono devs are getting tired of
desktop it seems.)
** Description changed:
libgdiplus' cairo backend only takes the fontconfig *match* to render
glyphs in cairo, with zero considerations for substitutes. This causes
significant problems when a developer using WinForms tries to display
some CJK glyphs in "Sans", while expecting system-like handling for
these bugs. Tofus will show up in such cases if the first candidate
generated from `fc-match Sans` is not a font with CJK glyphs.
This modified version of WinForms 'hello world' should be able to show this
bug when fc-match satisfies the said conditions:
- (Consider changing "Sans" to non-CJK fonts like "Liberation Sans" for stable
reproduction.)
+ (Consider changing "Sans" to non-CJK fonts like "Liberation Sans" for stable
reproduction. "Sans" is usually easier to mess with (by specifying LC_ALL, for
example) though.)
```C#
using System;
using System.Drawing;
using System.Windows.Forms;
public class HelloWorld : Form
{
static public void Main ()
{
Application.Run (new HelloWorld ());
}
public HelloWorld ()
{
Button b = new Button ();
b.Text = "Tofus? → 我是方框。";
b.Font = new Font("Sans", 11);
b.Click += new EventHandler (Button_Click);
Controls.Add (b);
}
private void Button_Click (object sender, EventArgs e)
{
MessageBox.Show ("Does it taste good?");
}
}
```
Note this problem is not limited to "Sans", nor CJK chars -- I am just
using these for a common-enough example. In real life developers trying
to do cross-platform Winforms development might instead just use the
default fonts ("MS Sans Serif" or "Tahoma" on Mono), and still bump into
the very same blocks of tofu, perhaps with the emojis sent by their
happy users.
A possible workaround is to try the experimental pango backend, but that
is really very experimental. There is a pending PR at
https://github.com/mono/libgdiplus/pull/39, which is said to be
"basically approved" back in 2009. (Yeah, mono devs are getting tired of
desktop it seems.)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1578749
Title:
fontconfig substitutes not considered by libgdiplus
To manage notifications about this bug go to:
https://bugs.launchpad.net/libgdiplus/+bug/1578749/+subscriptions
--
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs