MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   Create a CSS-file from fonts (https://www.mobileread.com/forums/showthread.php?t=259980)

Doitsu 06-14-2016 04:15 PM

Sounds fine to me, too.

Ghod 03-01-2018 02:29 AM

Hmmm...just installed and ran this plugin, but after running it, clicking on close just made it run again. Clicking on the X to close the window did the same. What did work, was to hit ESC (a few times--perhaps overkill, but it was preventing me from checking its work and saving the file).

I'm running Sigil 0.9.9 on Win10 x64.

This is actually the very first time I've installed and run a plugin. Mostly because it's taken me forever to get around to try building an epub from scratch. I'm trying to get my act together so I can provide my blind friend books he has no access to otherwise.

Doitsu 03-01-2018 04:38 AM

Quote:

Originally Posted by Ghod (Post 3663756)
Hmmm...just installed and ran this plugin, but after running it, clicking on close just made it run again.

This is a rare bug that only occurs if you install a plugin for the first time, assign it to a button and then click that button.
For the time being, the only way to fix it is to restart Sigil.

Quote:

Originally Posted by Ghod (Post 3663756)
I'm trying to get my act together so I can provide my blind friend books he has no access to otherwise.

You might want to check out KevinH's Access-Aide plugin, which'll automatically add DAISY-recommended attributes for screen readers.

Ghod 04-09-2018 07:41 PM

Quote:

Originally Posted by Doitsu (Post 3663785)
This is a rare bug that only occurs if you install a plugin for the first time, assign it to a button and then click that button.
For the time being, the only way to fix it is to restart Sigil.

So I probably shouldn't see it pop up again...

You might want to check out KevinH's Access-Aide plugin, which'll automatically add DAISY-recommended attributes for screen readers.

I will certainly do that. Thanks.

Leonatus 04-14-2019 11:48 AM

Sigil v. 0.9.13, css_from_fonts v. 0.1.3 phthon v. 3.4.
The plugin worked all right until now, but recent- and steadily I receive this message:
Code:

Status: failed

Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 135, in launch
    self.exitcode = target_script.run(container)
  File "C:\Users\Jürgen\AppData\Local\sigil-ebook\sigil\plugins\CSSFromFonts\plugin.py", line 16, in run
    font_object = ImageFont.truetype(font_path)
  File "site-packages\PIL\ImageFont.py", line 280, in truetype
  File "site-packages\PIL\ImageFont.py", line 145, in __init__
OSError: cannot open resource
Error: cannot open resource

No idea what it is. Might someone help, please?
Edit: Inserting @font-face manually works.

Doitsu 04-14-2019 12:29 PM

Quote:

Originally Posted by Leonatus (Post 3831462)
Sigil v. 0.9.13, css_from_fonts v. 0.1.3 phthon v. 3.4.
The plugin worked all right until now, but recent- and steadily I receive this message:

The plugin uses PIL for getting font properties. In rare cases PIL fails to retrieve font properties. PIL will most likely also fail to get the font properties of obfuscated fonts, which are sometimes embedded in commercial epubs.

What's the name of the font and where did you download it from?

Leonatus 04-15-2019 05:35 AM

Quote:

Originally Posted by Doitsu (Post 3831472)
What's the name of the font and where did you download it from?

The font is called FoglihtenNo04 by glukfonts.pl. It' an otf font.
I use it for years and without problems.
What is PIL?

Doitsu 04-15-2019 06:03 AM

Quote:

Originally Posted by Leonatus (Post 3831668)
What is PIL?

PIL is a Python Image Library.

Quote:

Originally Posted by Leonatus (Post 3831668)
The font is called FoglihtenNo04 by glukfonts.pl.

The plugin worked fine with this font on my Windows machine and generated the following CSS declaration:

Code:

@font-face {
    font-family: 'FoglihtenNo04';
    font-weight: normal;
    font-style: normal;
    src: url('../Fonts/FoglihtenNo04-070.otf');
}

If the plugin previously worked with FoglihtenNo04, maybe the font file that you downloaded got corrupted or was locked by another process, e.g. a virus scanner or a backup tool, when you ran the plugin.

Does the plugin work with other fonts or do you get the same error message for all fonts?

Leonatus 04-15-2019 12:36 PM

I tried the same font on my other computer (both Win 10, 32 bit), where I had Sigil v. 0.9.10 installed, and everything is exactly as in your example (as it used to be with my first computer as well). I installed Sigil v. 0.9.13, and everything is o.k. as well.
Whereas, on my first computer, I reloaded the font from another source, and there came the same error message. I tried it with a different font, same error.
Edit: I tried it on a different ebook with the same result. Nota bene: adding the @font-face manually, everything is all right.
And, strange enough, after having transferred the origiginal epub to my second computer with the same loaded font, the plugin works without any issue.

Doitsu 04-15-2019 01:24 PM

Quote:

Originally Posted by Leonatus (Post 3831754)
Whereas, on my first computer, I reloaded the font from another source, and there came the same error message.

Most likely the font that causes the error is corrupted. Unless you can reproduce this error with a well-known font downloaded from the font developer's website, there's nothing I can do about it.

Leonatus 04-15-2019 03:39 PM

Well, I thank you for your help so far, and I don't want to be urging. However, I'm wondering, when a corrupted font should be the culprit, how the issue can occur with any other font that I use, and how it can be that, running the identic epub on another computer, the issue doesn't appear, and how the font can work if I add the respective css manually.
I downloaded and installed the plugin from scratch, but to no avail.

Doitsu 04-15-2019 04:23 PM

Quote:

Originally Posted by Leonatus (Post 3831810)
However, I'm wondering, when a corrupted font should be the culprit, how the issue can occur with any other font that I use[...]

You didn't mention that the issue also occurs with other fonts and you didn't provide a test epub. Obviously, I can only fix issues that I (or other Sigil users) can reproduce.

Leonatus 04-15-2019 04:26 PM

Of course, that's true. But the strange is that the issue occurs on one computer, but not on the other. Thus, I fear, the problem might not be reproducable.

PeterT 04-15-2019 07:21 PM

Quote:

Originally Posted by Leonatus (Post 3831835)
Of course, that's true. But the strange is that the issue occurs on one computer, but not on the other. Thus, I fear, the problem might not be reproducable.

I wonder if that system has an invalid font (not the one you're embedding). See https://www.techwalla.com/articles/h...-corrupt-fonts for some discussion of tools to validate fonts.

Leonatus 04-16-2019 05:06 AM

Quote:

Originally Posted by PeterT (Post 3831903)
See https://www.techwalla.com/articles/h...-corrupt-fonts for some discussion of tools to validate fonts.

Thank you! I shall try this, but I have little hope, as I had used the font for years on both computers without issue. It seems there is some interference of the computer system.


All times are GMT -4. The time now is 06:52 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.