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
Display your calendar on the wallpaper.

wallCal Have your calendar appear as the wallpaper. disclaimer Use at your own risk. Don't blame me if you miss a meeting :-) Some parts of the script

7 Jun 14, 2022
New time-based UUID formats which are suited for use as a database key

uuid6 New time-based UUID formats which are suited for use as a database key. This module extends immutable UUID objects (the UUID class) with the fun

26 Dec 30, 2022
Check username

Checker-Oukee Check username It checks the available usernames and creates a new account for them Doesn't need proxies Create a file with usernames an

4 Jun 05, 2022
python-codicefiscale: a tiny library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale.

python-codicefiscale python-codicefiscale is a tiny library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale. Features T

Fabio Caccamo 53 Dec 14, 2022
Application for easy configuration of swap file and swappiness priority in slackware and others linux distributions.

Swap File Program created with the objective of assisting in the configuration of swap file in Distributions such as Slackware. Required packages: pyt

Mauricio Ferrari 3 Aug 06, 2022
Set of scripts for some automation during Magic Lantern development

~kitor Magic Lantern scripts A few automation scripts I wrote to automate some things in my ML development efforts. Used only on Debian running over W

Kajetan Krykwiński 1 Jan 03, 2022
ZX Spectrum Utilities: (zx-spectrum-utils)

Here are a few utility programs that can be used with the zx spectrum. The ZX Spectrum is one of the first home computers from the early 1980s.

Graham Oakes 4 Mar 07, 2022
Quickly edit your slack posts.

Lightning Edit Quickly edit your Slack posts. Heavily inspired by @KhushrajRathod's LightningDelete. Usage: Note: Before anything, be sure to head ove

14 Nov 19, 2021
Entropy-controlled contexts in Python

Python module ordered ordered module is the opposite to random - it maintains order in the program. import random x = 5 def increase(): global x

HyperC 36 Nov 03, 2022
Compute the fair market value (FMV) of staking rewards at time of receipt.

tendermint-tax A tool to help calculate the tax liability of staking rewards on Tendermint chains. Specifically, this tool calculates the fair market

5 Jan 07, 2022
API Rate Limit Decorator

ratelimit APIs are a very common way to interact with web services. As the need to consume data grows, so does the number of API calls necessary to re

Tomas Basham 575 Jan 05, 2023
This two python programs can convert km to miles and miles to km

km-to-miles These two little python programs can convert kilometers to miles and miles to kilometers Needed Python3 or a online python compiler with t

Chandula Janith 3 Jan 30, 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
Attempts to crack the compression puzzle.

The Compression Puzzle One lovely Friday we were faced with this nice yet intriguing programming puzzle. One shall write a program that compresses str

Oto Brglez 14 Dec 29, 2022
A simple and easy to use Spam Bot made in Python!

This is a simple spam bot made in python. You can use to to spam anyone with anything on any platform.

7 Sep 08, 2022
A multipurpose python module

pysherlock pysherlock is a Python library for dealing with web scraping using images, it's a Python application of the rendertron headless browser API

Sachit 2 Nov 11, 2021
MicroMIUI - Script to optimize miui and not only

MicroMIUI - Script to optimize miui and not only

Groiznyi-Studio 1 Nov 02, 2021
ecowater-softner is a Python library for collecting information from Ecowater water softeners.

Ecowater Softner ecowater-softner is a Python library for collecting information from Ecowater water softeners. Installation Use the package manager p

6 Dec 08, 2022
Minimal Windows system information tool written in Python

wfetch wfetch is a Minimal Windows system information tool written in Python (Only works on Windows) Installation First of all have python installed.

zJairO 3 Jan 24, 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