Menu

#425 Font handler for 7zip

open
nobody
FontHandler (1)
5
2024-03-29
2024-02-08
Roger Moser
No

I wrote a font handler for 7zip.
It can extract fonts from a font collection (.ttc)
or extract font tables from a TrueType or OpenType font.

Copy FontHandler.cpp (in the attached file) to CPP\7zip\Archive\
and add the file name to the following files after "FlvHandler.cpp":
CPP\7zip\7zip_gcc.mak
CPP\7zip\Bundles\Format7zF\ Arc.mak
CPP\7zip\Bundles\Format7zF\Arc_gcc.mak
CPP\7zip\Bundles\Format7zF\Format7z.dsp

1 Attachments

Discussion

  • Igor Pavlov

    Igor Pavlov - 2024-02-08

    I do not include third-party code to 7-zip now.
    But you can compile DLL version (plugin) of your code.
    So if users will place your compiled DLL to Formats folder, it will work with original 7-Zip.
    you can get compile example here:

    CPP\7zip\Archive\7z\makefile
    
     
  • Sam Tansy

    Sam Tansy - 2024-03-29

    Tried to test that and compile it as codec. Had include <ctype.h> for `isalnum'. While in Linux it went well and compiled and linked, in Windows it gave whole bunch of undefined references. Here is whole dump.

    So to make it work it requires some building script or I miss something.

     
    • Roger Moser

      Roger Moser - 2024-03-29

      If you want to make a Windows DLL, you also have to compile and link the source files like CopyCoder.cpp that contain the symbols not found by the linker. I have not done this. Rather, I just added FontHandler.cpp to the makefiles of 7-zip.

       
      • Sam Tansy

        Sam Tansy - 2024-03-29

        I used FontHandler.cpp ./CPP/7zip/Compress/CodecExports.cpp ./CPP/7zip/Compress/DllExportsCompress.cpp. This is what I always needed for it. It was enough to compile and link under Linux after all.
        I have added '', and it maybe is less of undefined references but still half of the Mendeleev's table.

         
    • Sam Tansy

      Sam Tansy - 2024-03-29

      Tried it in Linux and it compiled and linked but 7z says 'E_FAIL : Unspecified error':

       $ ./7z i
      
      7-Zip 23.01 (x86) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
      
      Codec Load Error: ./Codecs/FontHandler_Codec.so : E_FAIL : Unspecified error
      
      
      Libs:
       0 : 23.01 : ./7z.so
      

      What to debug to find a cause?

       
      • Roger Moser

        Roger Moser - 2024-03-29

        I cannot help you because I do not have Linux and I do not know how to make a plugin for 7zip.

         

Log in to post a comment.