A Tool that provides automatic kerning for ligature based OpenType fonts in Microsoft Volt

Overview

Kerning

A Tool that provides automatic kerning for ligature based OpenType fonts in Microsoft Volt

There are three stages of the algorithm.

  • The first stage is to process every single glyph image and extract the extents of the strokes in terms of height at several horizontal locations. The output can be plotted by plot_glyph_data in module heights
import source.heights as ht
ht.plot_glyph_data(LookUp,"path/to/glyph.png","glyph")

LookUp is a dictionary that is output of the stage 1 processing:

import source.ligature_kerning as lk
lk.process_stage_1()
  • LookUp is automatically saved in obj/ folder after the stage processing finishes.
  • Following are some examples of the output: Reh glyph or glyph flsvin glyph Red dots depict the bottom height of the glyph at a shift of 200 points. The green dots depict the same but from the top. The idea to check if any two glyphs would fit over each other for X amount of shift? Once the red dots from the left glyph can fit on top of the green dots of the right glyph, the kerning is possibble. Example: In the following example the two glyphs show can kern by 600 (3*200) units.
  • The second stage of processing is meant to calculate, for each 200 uints of horizontal shift how much glyphs will fit on top of it without collision. This data is stord is right collision list. Another scenario is caculate how many glyphs can this particular glyph fit on top of, for each shift of 200 uints. This part is most intensive calculation wise as it has O(N^2) complexity.
  • The last stage of processing is to form groups of glyphs based on collision data (output of stage 2) and the glyph height data (output of stage 1) in order to generate volt files (that can be used to implement kerning in OpenType fonts.)

Prerequisites

Development environment

Latest versions of the following packages are recommended:

  • Python 3.6 or higher
  • NumPy
  • OpenCv
  • Matplotlib

Glyph setup

Ligatures/Glyphs should be contained in a base directory (e.g. C:/Ligatures) having the following sub-directories (in PNG format):

  • Ligatures_Regular This directory contains all the multi character glyph e.g. sbb (سبب), slslo (سلسلہ), etc.
  • Haroof_Regular This Directory contains all the haroof (alphabets) glyph images in PNG format
  • Symbols This directory contains all the symbols like parenthesis, period, commas, etc.
  • Ligatures_Kashida This directory contains kasheeda (italicised or elongated) glyphs
  • Haroof_Kashida This directory contains kasheeda alphabets

Assumptions about input images

We assume that the glyphs are 2048 upm and the PNG Images generated are 300 dpi. This setting roughly gives image height of ~750 pixels.

You might also like...
Stubmaker is an easy-to-use tool for generating python stubs.

Stubmaker is an easy-to-use tool for generating python stubs. Requirements Stubmaker is to be run under Python 3.7.4+ No side effects during

PyHook is an offensive API hooking tool written in python designed to catch various credentials within the API call.
PyHook is an offensive API hooking tool written in python designed to catch various credentials within the API call.

PyHook is the python implementation of my SharpHook project, It uses various API hooks in order to give us the desired credentials. PyHook Uses

It is a tool that looks for a specific username in social networks
It is a tool that looks for a specific username in social networks

It is a tool that looks for a specific username in social networks

This tool lets you perform some quick tasks for CTFs and Pentesting.
This tool lets you perform some quick tasks for CTFs and Pentesting.

This tool lets you convert strings and numbers between number bases (2, 8, 10 and 16) as well as ASCII text. You can use the IP address analyzer to find out details on IPv4 and perform abbreviation as well as expansion on IPv6 addresses.It can also perform a two's complement calculation as well.

a tool for annotating table

table_annotate_tool a tool for annotating table motivated by wiki2bio,we create a tool to annoate all types of tables,this tool can annotate a table w

A simple tool that updates your pubspec.yaml file, of a Flutter project, without altering the structure of your file.
A simple tool that updates your pubspec.yaml file, of a Flutter project, without altering the structure of your file.

A simple tool that updates your pubspec.yaml file, of a Flutter project, without altering the structure of your file.

A tool written in python to generate basic repo files from github
A tool written in python to generate basic repo files from github

A tool written in python to generate basic repo files from github

Simple Python tool that generates a pseudo-random password with numbers, letters, and special characters in accordance with password policy best practices.
Simple Python tool that generates a pseudo-random password with numbers, letters, and special characters in accordance with password policy best practices.

Simple Python tool that generates a pseudo-random password with numbers, letters, and special characters in accordance with password policy best practices.

SmarTool - Smart Util Tool for Python

A set of tools that keep Python sweeter.

Releases(v0.1)
  • v0.1(Sep 18, 2021)

    This is a stable release. Tested for different Nastaliq font types (Dehlavi and Lahori)

    Please use 1000+ ligatures for correct processing. If the ligatures are very few, please change the thresholds in source/settings.txt file.

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Sep 14, 2021)

  • v0.0.4(Sep 9, 2021)

    1. Haroof kerning fix for Lahoori Nastaleeq fonts.
    2. General Improvements to kerning
    3. Settings file change.
    4. Group formation made more general (less dependent on user input/settings file)
    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Sep 5, 2021)

    This release targets a few bug fixes as well as the following changes:

    1. Settings file was not taking effect, this bug has been fixed.
    2. Group formation was erroneous for the lowest group, giving rise to the exclusion of lowest height glyphs. The fix has been made.
    3. The height limit for input images has been widened due to feedback from users (as some Lahori Nastaleeq fonts can go up to 1200 pixels high)
    4. To ensure the baseline is the same for all glyphs, there is an additional check to ensure all input images are of the same height.
    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(Aug 30, 2021)

    First release mainly for windows users (as it is used to generate VOLT files, which is a Windows tool). Code has been tested on Windows 10. BAT files are added to make life easy for users who are not well versed in Python.

    Source code(tar.gz)
    Source code(zip)
Owner
Sayed Zeeshan Asghar
Sayed Zeeshan Asghar
Auto-generate /etc/hosts for HackTheBox machines

Auto-generate /etc/hosts for HackTheBox machines Save yourself some tedium on getting started on a new machine by having your /etc/hosts ready to go.

3 Feb 16, 2022
Delete all of your forked repositories on Github

Fork Purger Delete all of your forked repositories on Github Installation Install using pip: pip install fork-purger Exploration Under construc

Redowan Delowar 29 Dec 17, 2022
Conveniently measures the time of your loops, contexts and functions.

Conveniently measures the time of your loops, contexts and functions.

Maciej J Mikulski 79 Nov 15, 2022
A hashtag from string extract python module

A hashtag from string extract python module

Fayas Noushad 3 Aug 10, 2022
Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc.

citation-url Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc. This module has a single parse() function that takes in

Charles Tapley Hoyt 2 Feb 12, 2022
password generator

Password generator technologies used What is? It is Password generator How to Download? Download on releases Clone repo git clone https://github.com/m

1 Dec 16, 2021
A simple package for handling variables in string.

A simple package for handling string variables. Welcome! This is a simple package for handling variables in string, You can add or remove variables wi

1 Dec 31, 2021
A pythonic dependency injection library.

Pinject Pinject is a dependency injection library for python. The primary goal of Pinject is to help you assemble objects into graphs in an easy, main

Google 1.3k Dec 30, 2022
✨ Un chois aléatoire d'un article sur Wikipedia totalement fait en Python par moi, et en français.

Wikipedia Random Article ❗ Un chois aléatoire d'un article sur Wikipedia totalement fait en Python par moi, et en français. 🔮 Grâce a une requète a w

MrGabin 4 Jul 18, 2021
Color getter (including method to get random color or complementary color) made out of Python

python-color-getter Color getter (including method to get random color or complementary color) made out of Python Setup pip3 install git+https://githu

Jung Gyu Yoon 2 Sep 17, 2022
Collection of code auto-generation utility scripts for the Horizon `Boot` system module

boot-scripts This is a collection of code auto-generation utility scripts for the Horizon Boot system module, intended for use in Atmosphère. Usage Us

4 Oct 11, 2022
iOS Snapchat parser for chats and cached files

ParseSnapchat iOS Snapchat parser for chats and cached files Tested on Windows and Linux install required libraries: pip install -r requirements.txt c

11 Dec 05, 2022
Export watched content from Tautulli to the Letterboxd CSV Import Format

Export watched content from Tautulli to the Letterboxd CSV Import Format

Evan J 5 Aug 31, 2022
Hide new MacBook Pro notch with black wallpaper.

Hide new MacBook Pro notch with black wallpaper.

Wang Chao 1 Oct 27, 2021
Every 2 minutes, check for visa slots at VFS website

vfs-visa-slot-germany Every 2 minutes, check for visa slots at VFS website. If there are any, send a call and a message of the format: Sent from your

12 Dec 15, 2022
✨ Un pierre feuille ciseaux totalement fait en Python par moi, et en français.

Pierre Feuille Ciseaux ❗ Un pierre feuille ciseaux totalement fait en Python par moi. 🔮 Avec l'utilisation du module "random", j'ai pu faire un choix

MrGabin 3 Jun 06, 2021
ColorController is a Pythonic interface for managing colors by english-language name and various color values.

ColorController.py Table of Contents Encode color data in various formats. 1.1: Create a ColorController object using a familiar, english-language col

Tal Zaken 2 Feb 12, 2022
Color box that provides various colors‘ rgb decimal code.

colorbox Color box that provides various colors‘ rgb decimal code

1 Dec 07, 2021
Python program for Linux users to change any url to any domain name they want.

URLMask Python program for Linux users to change a URL to ANY domain. A program than can take any url and mask it to any domain name you like. E.g. ne

2 Jun 20, 2022
Backman is a random/fixed background image setter for wlroots based compositors

backman Backman is a random/fixed background image setter for wlroots based compositors Dependencies: The program depends on swaybg, python3-toml (or

Hemish 3 Mar 09, 2022