Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: invalid face handle #531

Closed
shomke opened this issue Dec 10, 2020 · 13 comments
Closed

OSError: invalid face handle #531

shomke opened this issue Dec 10, 2020 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@shomke
Copy link

shomke commented Dec 10, 2020

All releases from version 2.1.1 give me the ''OSError: invalid face handle error'' (sometimes a direct crash) on clicking the Take Off button. Version 2.1.0 and previous versions work fine.
Issue related with kneeboards?
Clean reinstallation of DCS doesn't solve the issue.

Capture

@Khopa Khopa added the bug Something isn't working label Dec 10, 2020
@DanAlbert
Copy link
Member

python-pillow/Pillow#3066 hints that this might be fixed by updating to the (not yet released, I think) new version of pillow. That seems to be related to non-ascii text though, which I don't think we'd be printing to the kneeboard.

@Khopa
Copy link
Collaborator

Khopa commented Dec 11, 2020

What is your system language/locale ?

@DanAlbert Maybe this could happen if a font is not installed too ?

@shomke
Copy link
Author

shomke commented Dec 11, 2020

Win10 Pro, in English. Based in Norway.

@DanAlbert
Copy link
Member

We ship the fized-width font we use, but do rely on the system having Arial. If there's something odd about the Arial on your system that could explain it. We ought to be shipping all our fonts regardless though.

@shomke
Copy link
Author

shomke commented Dec 11, 2020

Capture
Those are the fonts I have installed on my system. Any additional font I could install manually to test out?

@shomke
Copy link
Author

shomke commented Jan 28, 2021

Hi again. I have been testing again, with puzzling results.
Here is the measured outcome when clicking the Take Off button.

Direct crash - c.a. 60%
''OSError: invalid face handle error'' message - c.a. 30%
Works fine, mission popup ok - c.a. 10%

So I manage to play. Just take a bit of effort before I eventually avoid the crash...
Puzzling because it looks random.

@walterroach
Copy link
Contributor

Report from Discord user Hanne:

It seems that I fixed the bug - at least 5/5 attempts just worked. I took a look at kneeboard.py, discovered the "Inconsolata.otf" used and then installed it from the fonts folder. Since then, the familiar mission start screen comes up and the comando line is clean.

@shomke
Copy link
Author

shomke commented Mar 9, 2021

I installed manually the Inconsolata.otf font yesterday, but the bug is still here for me.

@Hanninho
Copy link
Contributor

I looked into the bug again and discovered the following hint: python-pillow/Pillow#3066 (comment)

Accordingly, I modified the fonts of the KneeboardPageWriter:

        self.title_font = ImageFont.truetype("arial.ttf", 32, layout_engine=ImageFont.LAYOUT_BASIC)
        self.heading_font = ImageFont.truetype("arial.ttf", 24, layout_engine=ImageFont.LAYOUT_BASIC)
        self.content_font = ImageFont.truetype("arial.ttf", 20, layout_engine=ImageFont.LAYOUT_BASIC)
        self.table_font = ImageFont.truetype("resources/fonts/Inconsolata.otf", 20, layout_engine=ImageFont.LAYOUT_BASIC)

I'm more cautious with my predictions now, but I have been able to generate different missions so far.

@shomke
Copy link
Author

shomke commented Apr 3, 2021

I don't really know how to test it, I doesn't manage to run Liberation from the source so far.
I hope that the fix solves the error and can be pushed :)

Hanninho added a commit to Hanninho/dcs_liberation that referenced this issue Apr 10, 2021
Transfered my fix (dcs-liberation#531 (comment)) into the code.
@Hanninho Hanninho mentioned this issue Apr 10, 2021
@DanAlbert
Copy link
Member

Fix seems plausible. If someone experiencing this bug could verify the build from https://github.com/Khopa/dcs_liberation/actions/runs/736833008 we'll merge.

DanAlbert pushed a commit that referenced this issue Apr 11, 2021
The libraqm backed layout engine causes crashes on some machines.

Fixes #531.

(cherry picked from commit 2a1127e)
@DanAlbert
Copy link
Member

Thanks @Hanninho for the fix. I've merged to 2.5 and also cherry-picked to 2.4 in case we end up doing a 2.4.4, which seems likely.

@shomke
Copy link
Author

shomke commented Apr 12, 2021

I confirm that the fix works! Thanks for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants