Code Monkey home page Code Monkey logo

fontpacker's Introduction

FontPacker Beta Version 0.3

Features

  • Fully Cross-Platform. Can be run in mono.
  • Selection of Glyphs to export.
  • Easy to read XML format.
  • Accurate advance widths.
  • Nice Easy To Use User Interface.
  • Included Font Tester to test exported fonts.
  • Supports all the fonts supported in the host OS.

Licence

This project is licenced with GNU Lesser Public Licence (LGPL) and the terms here.

You can use the FontPack library for free in C# projects and you can even sell the projects using this library.

You can use the JFontPack library for free in Java projects. It requires Apache Commons Codec library which is licenced as Apache Commons Licence to decode glyphs from Base64.

Using the Fonts

After you create a .fntpack file, you need to use it as XML. Here's the structure of the file.

The xml file starts normally with the xml declaration. Then comes the root tag <FontPacker> which contains the <Font> tag with an attribute name.

<Font name="Microsoft Sans Serif"> ... </Font>

Then comes the Glyph tags in the font tag with the following attributes.

  • char - The character value
  • data - The Base64 encoded PNG image of that glyph
  • xadvance - The pixels to move forward after drawing that glyph

Here's an example overview.

<?xml version="1.0" encoding="utf-8"?>
<FontPacker>
    <Font name="Microsoft Sans Serif">
        <Glyph char="A"
               data="....Base64 encoded PNG image here..."
               xadvance="33" />
        <Glyph char="B"
               data="....Base64 encoded PNG image here..."
               xadvance="30" />
    </Font>
</FontPacker>

Downloads

The downloads are available on my site here

Changes

  • Added progress bar and font tester
  • Fixed the packer to give correct values for xadvance
  • Fixed the glyph width measuring algorithm
  • Supports Italic Fonts and Script fonts

fontpacker's People

Contributors

sriharshachilakapati avatar

Watchers

WangHe avatar

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.