Code Monkey home page Code Monkey logo

monobit's People

Contributors

againpsychox avatar ksherlock avatar pluess avatar robhagemans avatar trevorld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

monobit's Issues

Some Bugs

  1. More than one enter in texte make error is ERROR: tuple index out of range before do not make this error.
  2. The VT52.yaff i dont know why he me superpose double chars by double chars? Always to insert Space Per Chars.
  3. Some code ANSI no working for example the character 0x85 make error is ERROR: tuple index out of range in the VT100.yaff and 0x83 make error is ERROR: min() arg is an empty sequence.

TypeError: expected str, bytes or os.PathLike object, not NoneType

Hello, I installed this to try to convert some Japanese FONTX files. When I typed "monobit-convert --help" in my terminal, I got a long python error message. Here it is in full:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/monobit-convert", line 5, in
from monobit.scripts.convert import main
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/init.py", line 12, in
from .pack import Pack, operations as _pack_operations
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/pack.py", line 10, in
from .font import Font, FontProperties
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/font.py", line 14, in
from .glyph import Glyph
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/glyph.py", line 11, in
from .encoding import is_graphical, is_blank
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/encoding.py", line 1346, in
for _file in files('monobit.charmaps.freedos').iterdir():
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/resources.py", line 147, in files
return _common.from_package(_get_package(package))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 14, in from_package
return fallback_resources(package.spec)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 18, in fallback_resources
package_directory = pathlib.Path(spec.origin).parent
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1082, in new
self = cls._from_parts(args, init=False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 707, in _from_parts
drv, root, parts = self._parse_args(args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 691, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

I get the same error when I type "monobit-banner --help" too.
I'm running on a Mid-2014 Macbook Pro with MacOS Catalina 10.15.7

Proposal New Banner Audio

Is possible to create a New banner utility for sound spectral, the points is marked into spectral, the top is high frequency the bottom is the low frequency.

Atari Font support

Not really an issue, but if you ever look into supporting Atari (GEM) bitmap fonts again. you may want to look at https://github.com/th-otto/gemfedit/blob/master/tools/fntconv.c. That repo also has the 6x6 system font (system08.fnt, was used for small icon lables) and the 16x32 system font (system20.fnt, only present in TT machines). And of course, that tool uses its own text-based format ;)

All Draw Font Not Working

The YAFF Working But DRAW Not Working For The Majoritary, But A Tiny Pretty Working.
A Error Out Is :::: ERROR: tuple.index(x): x not in tuple

You Can Fix It?

with python 3.9 on cygwin.

Dependencies?

There is no information, apart from browsing source code, what are dependences of the script. For example, I wanted to convert BDF font to PNG format (bitmap), but the script crashed due to not existing saver. I went into source code to look for some answer, and I finally find out the Image saver/loader require PIL library to be installed. In the image.py the failed import is caught but no information is printed (even with the --debug flag).

There should be at least information about this in README, but I guess ideally it would be if KeyError for png exception could be caught at formats.py and info about missing PIL (Pillow) library would be included.

int object is not iterable

Trying to convert from a png image, I installed pillow. Running with latest python3, i get this error:
image

BDF export does not work

I'm observing that conversion to the bdf format currently does not work. Here is a minimal, reproducible example:

$ wget https://github.com/fcambus/spleen/raw/master/spleen-6x12.bdf &> /dev/null
$ python3 convert.py spleen-6x12.bdf spleen.yaff &> /dev/null
$ python3 convert.py spleen.yaff spleen.bdf
ERROR: 'get-ordinal'

The error is thrown at line 478 of bdf.py:

        xlfd_props['DEFAULT_CHAR'] = font.get_ordinal(font.default_char)

Note the Font class defined in font.py does not define a get_ordinal() method but I'm not sure how to fix it.

Not an issue, maybe a feature request? Single character conversion?

Hi,

It seems like this tool has the potential to maybe help me out?

I'm looking to convert the devil face emoji to the sixel representation described here:
https://vt100.net/dec/vt320/soft_characters

So basically:

How do I convert the devil face emoji (or any emoji) into a sequence like this:
ESC P 1;1;1;0;0;2;0;0 { P ???owYn||~ywo?? / ?IRJaVNn^NVbJRI ESC \ [etc etc]}

It's the decoding to sixel that I don't really want to do by hand....

Dashen fonts

Greetings, I was elated to find this project -it would have saved me huge amounts of time back in '95 - '98. I'm hoping monobit can help me migrate some fonts forward. Trying monobit-convert load out with some pft files I see output like the following, where I'm wondering if the right-bearing info is just a warning or a fatal error?

name: ^Q
spacing: proportional
bounding-box: 0 0
font-id: ^Q
converter: monobit v0.36
source-name: amdl1103.pft
source-format: ChiWriter (0x0)
history: load -format=pcpaint
shift-up: 255

0x20:
    -

    right-bearing: 37


0x011f:
    -

    right-bearing: 8


0x0120:
    -

    right-bearing: 37

   ⋮

monobit-convert will produce a .png file, but the visual result is not intelligible to me. Trying BDF output gets the following error consistently:

ERROR: BDF default glyph must have a character or codepoint.
ERROR: integer division or modulo by zero

GitHub isn't allowing me to attach the pft files to help with investigation, so I've added them to a G-Drive folder here. Note that these are non-Roman fonts, they have Ethiopic glyphs:

https://drive.google.com/drive/folders/1Ttg30yOE6kAYosndFpHMrjm-Z6zKbNOq?usp=share_link

thanks!

Document .yaff in fileformats.archiveteam.org wiki

Hi, I have stumbled upon http://fileformats.archiveteam.org, from its FAQ :

The purpose of this wiki is to "Solve the File Format Problem".

The File Format Problem in this context is that over the last century, many types of electronic information have been presented in formats that are non-intuitive and subject to the rapidly-shifting interests of what is newest and best. As a result, thousands of programs, documents, images and binary files are in danger of being unreadable to later generations as no readily available information about accessing them is to be found. Various projects have been launched in the last 20 years to deal with this problem, but they all lack a groundswell of directed volunteers working to once and for all get all the disparate information into one place and easily referenced by all. This is the goal of this project.

The project started on November 1st, 2012. All are invited to register and contribute. The goal is to have a massive bulk of knowledge in one place for all to use and incorporate into other similar directories and sites, providing a needed resource for generations to come.

I have seen .bdf and .hex formats listed, but not .yaff. Do you think of this format being relevant enough to be written in the wiki as an interface format for bitmap fonts ?

propose to use unicode SQUARE

propose to use unicode SQUARE to display, maybe a new format name
U+25A0 | BLACK SQUARE (U+25A0) | ■ |
U+25A1 | WHITE SQUARE (U+25A1) | □ |

use ultraedit with Fixedsys font show this:

2023-02-06 090847

Generating a new Desktop/Web font file from PNGs?

Hello,
Thank you for this project which seems very clean and very well organized!!!
I would like to be sure that your project could help mine, which generates new letter renders for now.

I am generating black and white letters (could be any color on transparent background, or vector graphics as well), as shown here: https://github.com/labonneimpression/pix2chocolate#example-3---multiple-letter-chocolate-biscuits
using mostly python scripts and various executables.
For now my output file format is .png with background, but I can for sure end up other raster or vector formats if needed, without problem.
I would like to output some day a font that I could use in LibreOffice or Inkscape, or maybe any web page, loadable by CSS font-face, out of my generate letters image.

Could you please advise a way to use your tool to convert my raster or vector letter images into a proper font file for desktop/web applications?

Thanks!!

Padding defaulting to 1

When converting FON file to PNG I've noticed that it has 1px padding around each character (except for the outer edge of the image). while searching how to set padding in help, I've noticed that it says that it should actually default to 0. After explicitly setting padding to 0, the resulting image was as expected. Either the help is wrong or padding does not default to 0.

banner drops last column of pixels

It might just be my bad luck with the first font I selected, but I noticed that monobit-banner is dropping the last 'column' of bits:

................
................
................
................
................
................
@@.@@@...@@.@@@.
.@@...@...@@...@
.@....@...@....@
.@....@...@....@
.@....@...@....@
.@....@...@....@
.@....@...@....@
@@@..@@@.@@@..@@
................
................
................

This uses apple-mac/Espy_Serif_14.yaff (from The hoard), and text n n. This is solvable by adding a space to the input text n n :

..................
..................
..................
..................
..................
..................
@@.@@@...@@.@@@...
.@@...@...@@...@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
@@@..@@@.@@@..@@@.
..................
..................
..................

I'm not sure this is actually the result of an issue with the font, or in the monobit-banner code.
It's not world-shattering...

YAFF format support for multiple codepages

I would like to store a canonical version of a font in the YAFF format, that supports multiple codepages.
i.e. rather than making multiple copies for each different codepages (CP886, CP1251, etc...), I want a single font file that contains the remapping info (since the glyph bitmaps won't change). Is this possible? Currently it only seems possible to embed 2 encodings per YAFF (Unicode and encoding:).

I'm thinking an extension to the existing character label, to allow per character encoding to specified...?
e.g.

0x41:
latin_a:
+cp437: 0x12
+1251: 0x44
    ....
    .@..
    @.@.
    @@@.
    @.@.
    @.@.

I Cant Change Color Paper And Ink As Image

Hello/Hi Again A Bug Where I Cant Change Color As Image So Before I Can Change The Color
And The Default Color Writed Is False So What Color Default?

Im Tired You Regressing This Program Stop It!

.draw from .png

Hey, I made a bitmap font myself but I drew it in a png. As I understand a .draw would be a good intermediate representation to get to other formats, is there a way to convert from png to draw?
In case this is not possible, is there a format I can easily convert to from a .png?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.