cross-platform bitmap font implementation

Overview

Component for rendering text with bitmap font on all openfl targets.

This set of classes is heavily based on classes from pixelizer (https://github.com/johanp/Pixelizer) from Johan Peitz (johanpeitz.com) and BitmapText class from HaxePunk (https://haxepunk.com/)

It suppots AngelCode, XNA and monospace bitmap fonts.

Text in this component can be: - scaled (with size property); - tinted; - have shadow or outline of specified color; - have custom spacings between lines and characters on lines; - multiline or single line; - wrapped by character or by word; - left, right aligned or centered; - and some other small features.

Issues
  • BitmapTextAlign.RIGHT crops text when textfield.size not an integer

    BitmapTextAlign.RIGHT crops text when textfield.size not an integer

    Neko, Linux are fine, but when testing Flash and HTML5:

    textfield.size = 0.99; retro1

    textfield.size = 1; retro2

    I'm using the desyrel font: http://examples.phaser.io/_site/view_full.html?d=text&f=bitmap+fonts.js&t=bitmap%20fonts

    opened by MiltonW 5
  • Haxelib

    Haxelib

    Hey this is a wonderful class that would be helpful to nme developers as a haxelib. Haxeflixel could just have a dependency of that haxelib it looks like the same code? Cheers.

    opened by impaler 2
  • Shadow always blue for RENDER_BLIT targets

    Shadow always blue for RENDER_BLIT targets

    The shadow always renders blue for RENDER_BLIT targets.

    The problem is in BitmapFont.hx line 580.

    In this line the value should get assigned to "colorTransform.blueMultiplier" instead of "colorTransform.redMultiplier".

    opened by slangeder 0
  • Replaced all references to nme by references to openfl.

    Replaced all references to nme by references to openfl.

    Hi.

    I tried to use your project with new versions of Openfl and I needed to make some changes in order to it to work.

    Now I'm sending it to you in hope you integrate it in the original project.

    I did the following:

    • replaced all occurrences of nme by the openfl;
    • replaced all occurrences of Hash and IntHash by Map;
    • replace BitmapInt32 by Int;
    • removed the application.nmml file and added project.xml as it's the standard file name on Openfl.

    Regards.

    opened by plicatibu 0
  • Change PxBitmapFont's getPreparedGlyphs() method

    Change PxBitmapFont's getPreparedGlyphs() method

    replace the line: _colorTransform.color = pColor; with following: var colorMultiplier:Float = 0.00392; _colorTransform.redOffset = 0; _colorTransform.greenOffset = 0; _colorTransform.blueOffset = 0; _colorTransform.redMultiplier = (pColor >> 16) * colorMultiplier; _colorTransform.greenMultiplier = (pColor >> 8 & 0xff) * colorMultiplier; _colorTransform.blueMultiplier = (pColor & 0xff) * colorMultiplier;

    So it would have the same behavior on flash and cpp targets

    opened by Beeblerox 0
  • Saving BitmapData with pixelsnapping

    Saving BitmapData with pixelsnapping

    I Pix Is there any way to apply pixelsnapping function to BitmapData or is it only available for displayed Bitmaps? Does not make sense that images are saved with poor quality.

    opened by oltecam 0
  • updated using TileSet instead of TileSheet

    updated using TileSet instead of TileSheet

    Hi ! Thank you for sharing your code ! I updated it to work with recent versions of OpenFL and thought you might be interested ?

    The example project works fine with openFL 7.1.2

    opened by MatseFR 0
  • BitmapFont -> format library

    BitmapFont -> format library

    What do you think of pushing the format parsing and possibly layout logic (not rendering code) to https://github.com/HaxeFoundation/format? I know some of this originated in HaxePunk, it would be great to share your additions and improvements.

    opened by bendmorris 1
  • Not compatable with OpenFl 4.0.0

    Not compatable with OpenFl 4.0.0

    The Tilesheet class has been removed from OpenFl 4.0.0

    /opt/lib/haxelib/bitmapFont/0,9,4/bitmapFont/BitmapFont.hx:5: characters 7-31 : Type not found : openfl.display.Tilesheet

    opened by jarbot 2
  • Background transparency issue when using blitting

    Background transparency issue when using blitting

    I'm trying to add a semi-transparent background to the BitmapTextField, but when I'm setting the render mode to BLIT, the color and alpha are not properly displayed if I'm not using a complete solid color : bitmapfont

    The background color here is supposed to be 0xCC0000FF (slightly transparent blue), but as you can see it only appears in the top-left corner.

    Works perfectly in TILE mode.

    opened by elFlashor 0
  • Having some issues with latest version of openfl

    Having some issues with latest version of openfl

    At the moment I cannot even declare a bitmapfont or bitmaptextfield var without getting the following error:

    Source/bitmapFont/BitmapTextField.hx:1084: characters 3-27 : bitmapFont.BitmapFont has no field tilesheet

    opened by scarletsquig 0
Owner
Zaphod
Zaphod
A terminal-based, mouse-driven BDF (bitmap) font editor.

bdfedit A terminal-based, mouse-driven BDF font editor. Capable of reading, writing, and editing bitmap font files fully within the terminal, and enti

Andrew 4 Jun 8, 2022
Risc-V RV32IMAFC + 80s ERA SoC (bitmap + GPU, sprites, tilemaps)

A simple (no interrupts or exceptions/traps), Risc-V RV32IMAFC CPU, with a pseudo SMT (dual thread) capability. The display is similar to the 8-bit era machines, along with audio, SDCARD read support, UART and PS/2 keyboard input.

Rob S 17 Jun 3, 2022
A family of small, fast, and simple bitmap fonts in single-file C headers

Blit A family of small, fast, and simple bitmap fonts in single-file C headers [go to repository] These are not intended as a replacement for fancy us

Andrew Reece 49 May 18, 2022
Support for TrueType (.ttf) font files with Simple Directmedia Layer.

This library is a wrapper around the excellent FreeType 2.0 library

Simple Directmedia Layer 147 Aug 1, 2022
A font cooking library

Font Chef Font Chef is a cross-platform C99 and C++ library to create character atlas of pre-rasterized glyphs from a font at a specified size and col

Leonardo Guilherme de Freitas 45 Apr 25, 2022
C++ font-lock for Emacs

Syntax highlighting support for "Modern C++" - until C++20 and Technical Specification. This package aims to provide a simple highlight of the C++ lan

Ludwig PACIFICI 168 Jul 13, 2022
font rendering, Zep vim emulator, microui integration

LabFont This project is an exploration of getting text into a rendeing pipeline based on @floooh's sokol. Frameworks such as Dear ImGui solve text ren

Nick Porcino 13 Jan 23, 2022
Portable, Noto-powered font-rendering abstraction based on FreeType and Raqm

Mechascribe Mechascribe is still under construction and nothing is functional yet. Mechascribe is a text rendering abstraction trying to support as mu

null 4 Jan 27, 2022
Free (libre) font editor for Windows, Mac OS X and GNU+Linux

FontForge FontForge is a free (libre) font editor for Windows, Mac OS X and GNU+Linux. Use it to create, edit and convert fonts in OpenType, TrueType,

null 4.7k Aug 1, 2022
The Leap Motion cross-format, cross-platform declarative serialization library

Introduction to LeapSerial LeapSerial is a cross-format, declarative, serialization and deserialization library written and maintained by Leap Motion.

Leap Motion (Ultraleap) 15 Jan 17, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 275 Jul 18, 2022
Cross-platform C++11 header-only library for memory mapped file IO

mio An easy to use header-only cross-platform C++11 memory mapping library with an MIT license. mio has been created with the goal to be easily includ

null 1.3k Aug 4, 2022
Cross-platform, Serial Port library written in C++

Serial Communication Library (Linux and OS X) (Windows) This is a cross-platform library for interfacing with rs-232 serial like ports written in C++.

William Woodall 1.6k Aug 7, 2022
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 115 Jul 18, 2022
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

null 20 Jun 15, 2022
Cross-platform tool to extract wavetables and draw envelopes from sample files, exporting the wavetable and generating the appropriate SFZ text to use in a suitable player.

wextract Cross-platform tool to extract wavetables and draw envelopes from sample files, exporting the wavetable and generating the appropriate SFZ te

Paul Ferrand 9 Jan 5, 2022
Freeze OS is a cross-platform operating system emulator that runs on top of an interpreter called the Freeze interpreter.

Freeze OS is a cross-platform operating system emulator that runs on top of an interpreter called the Freeze interpreter. The operating system code is basically written in the Freeze programming language that is passed to the Freeze interpreter. The idea is to skip instances where the operating system needs to handle low level operators and focus on higher level stuff, like malware analysis, AI, and others.

null 24 May 2, 2022
Khepri is a Cross-platform agent, the architecture and usage like Coblat Strike but free and open-source.

Khepri Free,Open-Source,Cross-platform agent and Post-exploiton tool written in Golang and C++ Description Khepri is a Cross-platform agent, the archi

Young 1.3k Aug 10, 2022
JWM is a cross-platform Java window management and OS integration library.

JWM aims to expose an interface that abstracts over window creation, input handling and OS integration

JetBrains 345 Aug 8, 2022