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
Check subdomains for Open S3 buckets

SuBuket v1.0 Check subdomains for Open S3 buckets Coded by kaiz3n Basically, this tool makes use of another tool (sublist3r) to fetch subdomains, and

kaiz3n 4 Dec 29, 2021
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

Miek 1 Nov 02, 2021
Extract XML from the OS X dictionaries.

Extract XML from the OS X dictionaries.

Joshua Olson 13 Dec 11, 2022
A hashtag from string extract python module

A hashtag from string extract python module

Fayas Noushad 3 Aug 10, 2022
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
aws ec2.py companion script to generate sshconfigs with auto bastion host discovery

ec2-bastion-sshconfig This script will interate over instances found by ec2.py and if those instances are not publically accessible it will search the

Steve Melo 1 Sep 11, 2022
Set of utilities for exporting/controlling your robot in Blender

Blender Robotics Utils This repository contains utilities for exporting/controlling your robot in Blender Maintainers This repository is maintained by

Robotology 33 Nov 30, 2022
Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders Getting Started Install requirements with Anaconda: conda env c

T. Andy Keller 4 Aug 22, 2022
A simple language and reference decompiler/compiler for MHW THK Files

Leviathon A simple language and reference decompiler/compiler for MHW THK Files. Project Goals The project aims to define a language specification for

11 Jan 07, 2023
DUQ is a python package for working with physical Dimensions, Units, and Quantities.

DUQ is a python package for working with physical Dimensions, Units, and Quantities.

2 Nov 02, 2022
DiddiParser 2: The DiddiScript parser.

DiddiParser 2 The DiddiScript parser, written in Python. Installation DiddiParser2 can be installed via pip: pip install diddiparser2 Usage DiddiPars

Diego Ramirez 3 Dec 28, 2022
Shypan, a simple, easy to use, full-featured library written in Python.

Shypan, a simple, easy to use, full-featured library written in Python.

ShypanLib 4 Dec 08, 2021
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
A Randomizer Oracle

Tezos Randomizer Tezod Randomizer "Oracle". It's a smart contract that you can call to get a random number between X and Y (for now). It uses entropy

Asbjorn Enge 19 Sep 13, 2022
Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Fergus 1 Feb 02, 2022
PyResToolbox - A collection of Reservoir Engineering Utilities

pyrestoolbox A collection of Reservoir Engineering Utilities This set of functio

Mark W. Burgoyne 39 Oct 17, 2022
cssOrganizer - organize a css file by grouping them into categories

This python project was created to scan through a CSS file and produce a more organized CSS file by grouping related CSS Properties within selectors. Created in my spare time for fun and my own utili

Andrew Espindola 0 Aug 31, 2022
Standard implementations of FedLab and its provided benchmarks.

FedLab-benchmarks This repo contains standard implementations of FedLab and its provided benchmarks. Currently, following algorithms or benchrmarks ar

SMILELab-FL 104 Dec 05, 2022
A python module for extract domains

A python module for extract domains

Fayas Noushad 4 Aug 10, 2022
A functional standard library for Python.

Toolz A set of utility functions for iterators, functions, and dictionaries. See the PyToolz documentation at https://toolz.readthedocs.io LICENSE New

4.1k Dec 30, 2022