afrantzis / bless

Bless - Gtk# Hex Editor
GNU General Public License v2.0
210 stars 38 forks source link

Missing monospace font markers #25

Closed Erikvv closed 4 years ago

Erikvv commented 4 years ago

Screenshot_20191203_143448

Version: 0.6.2 installed from https://aur.archlinux.org/packages/bless/ Log:

$ bless PKGBUILD 
Could not find a part of the path '/home/erik/.config/bless/plugins'.
Could not find a part of the path '/home/erik/.config/bless/plugins'.
Could not find a part of the path '/home/erik/.config/bless/plugins'.
Could not find file "/home/erik/.config/bless/export_patterns"

I am running kde-plasma with no special configuration with regard to fonts. I do have several monospace fonts.

To solve it I tried changing the font as described here but this makes no difference

Erikvv commented 4 years ago

I missed that it was compiled, I though it was a binary.

I compiled from master and the issue persists. Build logs show no errors.

afrantzis commented 4 years ago

Hi! That's a strange issue... seems like pango (text engine library) is selecting a font that doesn't have basic glyphs. A few questions below to help us get to the bottom of this.

The default font is "Courier 12". Does the Courier font exist on your system? What does fc-match Courier output?

Also, when setting another font in the config file are you using the full name plus size (e.g., "Monospace 12")? Is the layout file you are changing actually used (check in Edit->Preferences->General->Default Layout)? What does fc-match Monospace output?

afrantzis commented 4 years ago

As an other test, how does the following layout look:

<layout>
    <area type="hexadecimal">
        <display>
            <font>Monospace 12</font>
        </display>
        <case>upper</case>
    </area>
</layout>

To use it, paste the above in ~/.config/bless/layouts/test.layout, then enable it using the View->Layouts menu item.

Erikvv commented 4 years ago
$ fc-match Monospace
andalemo.ttf: "Andale Mono" "Regular"

$ fc-match Courier
pcrr8a.pfb: "Courier" "Regular"

With your layout <font>Monospace 12</font> things work:

Screenshot_20191209_095231

but with <font>Courier 12</font> it is placeholders again.

So the issue seems specific to Courier on my system. Courier works in other applications though (intellij, browser, etc)

I can fix the issue now for myself but I'm not sure what adjustments if any should be done to make it work out-of-the-box.

afrantzis commented 4 years ago

@Erikvv Hi! I was finally able to reproduce this error locally, and have committed a workaround in a46b8cc. I haven't been able to debug why this particular font (and apparently some other Type 1 fonts) have started failing, but hopefully this workaround will provide a better user experience.

danielzgtg commented 3 years ago

I haven't been able to debug why this particular font (and apparently some other Type 1 fonts) have started failing

I just found out why the fonts started failing.

"Pango stopped supporting old x11 fonts between versions 1.43 and 1.44, breaking them for all gtk apps." Pango 1.44 and the removal of support for bitmap fonts

It seems that the problem is with this part of the stack because Bless, PyGTK, which all depend on Pango don't render Courier properly but Cairo, Mono, and Java do. Additionally, when temporarily downgrading from Ubuntu 20.04's Pango 1.44 to Ubuntu 19.10's Pango 1.42, the problem goes away.

Courier works in other applications though (intellij, browser, etc)

It does indeed work in those applications. For the browser, both Chrome and Firefox work. However, none of them are pure GTK applications. GIMP and gedit, which use GTK for font rendering, don't work.

fredericgermain commented 3 years ago

It seems bless has this problem on Ubuntu 20.04.

Modifying ~/.config/bless/layouts/test.layout didn't work.

But following this worked for me https://askubuntu.com/a/110625/284670

Wohlstand commented 3 years ago

Just now I made this: test.layout.gz works on Linux Mint 20 (based on Ubuntu 20.04), paste it into ~/.config/bless/layouts/ directory. Then, you should choose it in settings:

изображение

and voila! изображение