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
tade is a discussion/forum/link aggregator application. It provides three interfaces: a regular web page, a mailing list bridge and an NNTP server

tade is a discussion/forum/link aggregator application. It provides three interfaces: a regular web page, a mailing list bridge and an NNTP server

Manos Pitsidianakis 23 Nov 4, 2022
Pyfunctools is a module that provides functions, methods and classes that help in the creation of projects in python

Pyfunctools Pyfunctools is a module that provides functions, methods and classes that help in the creation of projects in python, bringing functional

Natanael dos Santos Feitosa 5 Dec 22, 2022
Color box that provides various colors‘ rgb decimal code.

colorbox Color box that provides various colors‘ rgb decimal code

null 1 Dec 7, 2021
Python based tool to extract forensic info from EventTranscript.db (Windows Diagnostic Data)

EventTranscriptParser EventTranscriptParser is python based tool to extract forensically useful details from EventTranscript.db (Windows Diagnostic Da

P. Abhiram Kumar 24 Nov 18, 2022
SH-PUBLIC is a python based cloning script. You can clone unlimited UID facebook accounts by using this tool.

SH-PUBLIC is a python based cloning script. You can clone unlimited UID facebook accounts by using this tool. This tool works on any Android devices without root.

(Md. Tanvir Ahmed) 5 Mar 9, 2022
Basic loader is a small tool that will help you generating Cloudflare cookies

Basic Loader Cloudflare cookies loader This tool may help some people getting valide cloudflare cookies Installation ?? : pip install -r requirements.

IHateTomLrge 8 Mar 30, 2022
Python tool to check a web applications compliance with OWASP HTTP response headers best practices

Check Your Head A quick and easy way to check a web applications response headers!

Zak 6 Nov 9, 2021
Handy Tool to check the availability of onion site and to extract the title of submitted onion links.

This tool helps is to quickly investigate a huge set of onion sites based by checking its availability which helps to filter out the inactive sites and collect the site title that might helps us to categories what site we are handling.

Balaji 13 Nov 25, 2022
A tool for testing improper put method vulnerability

Putter-CUP A tool for testing improper put method vulnerability Usage :- python3 put.py -f live-subs.txt Result :- The result in txt file "result.txt"

Zahir Tariq 6 Aug 6, 2021
Tool for generating Memory.scan() compatible instruction search patterns

scanpat Tool for generating Frida Memory.scan() compatible instruction search patterns. Powered by r2. Examples $ ./scanpat.py arm.ks:64 'sub sp, sp,

Ole André Vadla Ravnås 13 Sep 19, 2022