fontist / formulas

Fontist Font Formulas
6 stars 0 forks source link

Add support for Wingdings and Symbol fonts #70

Closed raffaem closed 3 years ago

raffaem commented 3 years ago

I am trying to open a PDF but it says that these fonts are missing:

Symbol, Wingdings, Wingdings 2, Wingdings 3.

Are these available from fontist?

I also told me that "MT Extra" was missing but I was able to install it

raffaem commented 3 years ago

Those fonts are available here

ronaldtse commented 3 years ago

MT Extra is available via Fontist.

Symbol, Wingdings, Wingdings 2, Wingdings 3 are not available in Fontist. We would prefer not directly downloading the fonts from some other package on GitHub due to potential licensing concerns.

The good news is that these fonts are available from here:

Including:

Let's link to this publicly published RPM package instead.

This package is also officially mentioned by an Atlassian Confluence support article: https://confluence.atlassian.com/confkb/the-text-in-a-powerpoint-excel-or-word-document-is-missing-or-looks-different-via-confluence-view-file-macro-200213562.html

ronaldtse commented 3 years ago

This package also contains:

raffaem commented 3 years ago

Good that we found a solution!

It is really important for people who comes from Windows and would like a smooth transition with Linux :)

ronaldtse commented 3 years ago

Moved to fontist/formula.

raffaem commented 3 years ago

Can you also add "MS PGothic"? https://bigfontsite.com/download/ms-pgothic.html#download

alexeymorozov commented 3 years ago

Would appreciate any help with cross-platform unarchiving of RPM packages. The ways I tried so far:

  1. seven_zip_ruby should support RPMs, as described here, but it fails on run.
  2. ffi-libarchive works at least on MacOS, but then it needs to install libarchive on Windows (from Chef or precompiled with fontist).
  3. arr-pm works on MacOS, but fails on Windows, since it uses the CLI xz utility.
  4. rupert could read filenames on all platforms, but seems it has no unarchiving feature.
ronaldtse commented 3 years ago

I think the only two viable options are rupert and seven_zip_ruby. Installation of libarchive can be complex.

@alexeymorozov it seems that rupert does have some method for data reading?

https://github.com/stefanozanella/rupert/blob/f4d88c0d1d2847d6a10a00592406bce440b1ffc0/lib/rupert/rpm/entry.rb#L61-L64

Seems like we will need to first traverse the index to find the correct Entry object, then call #resolve to obtain the data, seek the correct size, and write out the necessary file manually.

ronaldtse commented 3 years ago

@alexeymorozov I found this Source RPM package that can be directly un-tared, without necessary for RPM/CPIO unpacking:

https://download.opensuse.org/repositories/home:/Dead_Mozay/openSUSE_Tumbleweed/src/webcore-fonts-3.0-2.14.src.rpm

$ tar -zxvf webcore-fonts-3.0-2.14.src.rpm 
x webcore-fonts-3.0.tar.gz
x webcore-fonts.spec
$ tar -zxvf webcore-fonts-3.0.tar.gz 
x webcore-fonts/
x webcore-fonts/fonts/
x webcore-fonts/fonts/couri.ttf
x webcore-fonts/fonts/verdanaz.ttf
x webcore-fonts/fonts/cour.ttf
x webcore-fonts/fonts/arialbd.ttf
x webcore-fonts/fonts/comicbd.ttf
...
alexeymorozov commented 3 years ago

Thanks, Ronald! The source RPM appeared to be easier to extract from. Though still couldn't finish it.

Indeed rupert allows to extract an archive file just by reading content after a header here:

File.write("archive.cpio.gz", @raw_io.read)

The resulting file could be unarchived by GzipReader:

require 'zlib'
cpio = Zlib::GzipReader.open(filename)
File.write("archive.cpio", cpio.read)

But then we get the CPIO file:

$ file archive.cpio
archive.cpio: ASCII cpio archive (SVR4 with no CRC)

I've tried to unarchive it with this library with no success, because it supports only an old format. The formats differ by a magic number: 070707 for old, and 070701 for new.

The next step could be to rewrite the lib to support the new format.

ronaldtse commented 3 years ago

@alexeymorozov The webcore-fonts-3.0-2.14.src.rpm file can be extracted using just "tar", so there's no need for CPIO or RPM extraction. See the extraction log above.

alexeymorozov commented 3 years ago

I've tried to do it with TarReader but it didn't work out. Could it be because tar supports extraction from cpio by default?

man tar

This implementation can extract from tar, pax, cpio, zip, jar, ar, xar, rpm, 7-zip, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, 7-zip, and shar archives.

ronaldtse commented 3 years ago

Oh wow! Didn't know that the tar command supports them...

The next step could be to rewrite the lib to support the new format.

Let's create a new repo/gem that parses the new CPIO format (while also the old CPIO format): https://github.com/fontist/cpio/issues/1

alexeymorozov commented 3 years ago

Found working implementation of the CPIO unarchiver in unused files of arr-pm here.

Working draft (with some local files) of unarchiving of RPM is in https://github.com/fontist/fontist/pull/207

ronaldtse commented 3 years ago

@raffaem the fonts are now available since #74 released as fontist v1.8.4.

Please run:

$ gem install fontist
$ fontist update

Then you can install the fonts like:

fontist install symbol
fontist install 'wingdings 2'

Thanks again for the suggestion!

raffaem commented 3 years ago

@raffaem the fonts are now available since #74 released as fontist v1.8.4.

Please run:

$ gem install fontist
$ fontist update

Then you can install the fonts like:

fontist install symbol
fontist install 'wingdings 2'

Thanks again for the suggestion!

Thank you very much. I am having a very hectic period but I was still able to follow this, it is incredible the amount of effort you put into this.

Thank you so much.

Best regards