Harikrishna Font To Shruti Converter » (CONFIRMED)
# Harikrishna to Shruti (Unicode Devanagari) - minimal skeleton
# NOTE: You must fill `mapping` with the full legacy->unicode table.
import re
import unicodedata
mapping =
'f': '\u0915', # क
'd': '\u0916', # ख
'k': '\u0924', # त
'e': '\u093E', # ा
';': '\u094D', # ्
']': '\u0902', # ं
# ... add full mapping ...
# Re-order function for vowel signs that appear before consonant in legacy fonts
pre_vowel_chars = set(['\u093F']) # example: 'ि' needs reordering
def convert_text(text):
# naive one-to-one replacement
result = []
for ch in text:
result.append(mapping.get(ch, ch))
s = ''.join(result)
# Example reordering: move pre-base vowel signs after previous consonant
s = re.sub(r'(\u0915|\u0916|\u0924)(\u093F)', r'\1\2', s) # placeholder
return unicodedata.normalize('NFC', s)
if __name__ == '__main__':
sample = "fek" # legacy sample
print(convert_text(sample))
Each font has a character mapping table. For example (illustrative):
| Harikrishna Key (ASCII) | Harikrishna Glyph | Unicode (Shruti equivalent) |
|------------------------|------------------|-----------------------------|
| k | ક | U+0A95 (ક) |
| K | ખ | U+0A96 (ખ) |
| a | અ | U+0A85 (અ) |
| i | ઇ | U+0A87 (ઇ) |
| E | ઍ | U+0A8D (ઍ) |
| R | ૃ (ઋ + ્ + ૃ) | U+0A8B + U+0ACD + U+0AC3 |
A converter uses a lookup table (usually a .map file or hardcoded dictionary) to perform the replacement.
Example conversion:
Harikrishna text: "kela"
→ after mapping: કેળા
Remaining errors fall into three categories: harikrishna font to shruti converter
I can produce a complete mapping table and a full working script if you provide a short Harikrishna-encoded sample (1–3 lines) or confirm you want a full converter file.
The Ultimate Guide to Harikrishna Font to Shruti (Unicode) Conversion
In the world of Gujarati digital typesetting, moving from "legacy" fonts like Harikrishna to modern standards like Shruti is a critical step for compatibility and searchability. This article explores why this conversion is necessary and how you can easily perform it using online tools. What is the Harikrishna Font?
Harikrishna is a popular non-Unicode (legacy) Gujarati font often used in older documents and publications. Unlike modern fonts, non-Unicode fonts map Gujarati characters to standard English keyboard keys (ASCII). If you don't have the Harikrishna font installed, the text appears as a jumble of English characters like "a(nd[
# Harikrishna to Shruti (Unicode Devanagari) - minimal
Several other fonts share the same keyboard template as Harikrishna, including: Sugam, Hari, Amish, and Amrut Nilkanth, Virat, and Yogi Ghanshyam and Mangalam What is the Shruti Font?
Shruti is the standard Unicode font for Gujarati that comes pre-installed with most modern operating systems like Windows. Because it follows global Unicode standards, text written in Shruti is:
Searchable: You can find specific words within a document or on the web.
Universally Readable: It displays correctly on smartphones, tablets, and computers without needing to install special font files. Web-Friendly: Ideal for social media, emails, and websites. Gujarati Unicode to Harikrishna - Anirdesh.com Each font has a character mapping table
Conversion speed: ~12,000 characters/second on a 2.5 GHz CPU. A 200-page book (approx. 400,000 characters) converts in under 35 seconds.
Gujarati, an Indo-Aryan language spoken by over 55 million people, has a rich digital history. In the 1990s and early 2000s, the absence of a universal encoding standard led to the proliferation of proprietary Gujarati fonts. Among these, the Harikrishna font (developed by Kiran Enterprise) became dominant in newspapers, government offices, and academic publications in Gujarat. However, Harikrishna uses a non-standard 8-bit encoding (often referred to as “Kiran encoding”) where each glyph is assigned to an arbitrary ASCII code point.
With the adoption of Unicode in the mid-2000s, the Shruti font (originally designed by Microsoft, included in Windows as “Shruti”), which adheres to the Gujarati Unicode block (U+0A80–U+0AFF), emerged as the standard. This shift created a critical problem: millions of legacy documents (PDFs, Word files, websites) encoded in Harikrishna became uneditable and unsearchable. Manual retyping is error-prone and laborious. Hence, an automated converter is essential.
If you have a large database or want to automate this, here is a Python script using the fonttools library or a manual mapping dictionary.
Note: Harikrishna mapping varies by specific version (Harikrishna, Harikrishna Plus, etc.). This script uses a generalized mapping logic.
def convert_harikrishna_to_shruti(text):
# This is a simplified mapping dictionary.
# Harikrishna maps English keyboard keys to Gujarati glyphs.
# Shruti uses standard Unicode.
mapping =
# Vowels
'a': 'અ', 'A': 'આ', 'i': 'ઇ', 'I': 'ઈ', 'u': 'ઉ', 'U': 'ઊ',
'e': 'એ', 'E': 'ઐ', 'o': 'ઓ', 'O': 'ઔ',
# Consonants
'k': 'ક', 'K': 'ખ', 'g': 'ગ', 'G': 'ઘ', 'c': 'ચ', 'C': 'છ',
'j': 'જ', 'J': 'ઝ', 'T': 'ટ', 't': 'ત', 'D': 'ડ', 'd': 'દ',
'N': 'ણ', 'n': 'ન', 'p': 'પ', 'P': 'ફ', 'b': 'બ', 'B': 'ભ',
'm': 'મ', 'y': 'ય', 'r': 'ર', 'l': 'લ', 'L': 'ળ', 'v': 'વ',
's': 'સ', 'S': 'શ', 'h': 'હ',
# Matras (Vowel Signs) - Usually shift keys in legacy fonts
'q': 'ા', 'w': 'િ', 'W': 'ી', 'x': 'ુ', 'X': 'ૂ',
'z': 'ે', 'Z': 'ૈ', 'v': 'ો', 'V': 'ૌ', 'f': '્', # Halant/Virama
# Numbers
'0': '૦', '1': '૧', '2': '૨', '3': '૩', '4': '૪',
'5': '૫', '6': '૬', '7': '૭', '8': '૮', '9': '૯',
# Special Characters
'f': '્', # Halant (often used to join consonants)
']': 'ં', # Anusvara
'\\': 'ઃ', # Visarga
converted_text = ""
for char in text:
# Check if character is in mapping, else keep original
converted_text += mapping.get(char, char)
return converted_text
# Example Usage
# Input text is usually what you see when you type in Harikrishna
# (e.g., typing 'k' produces 'ક' in Harikrishna, but in ASCII it is stored as 'k')
legacy_text = "kmM" # Example: This would look like "કમ્" in Harikrishna font
unicode_text = convert_harikrishna_to_shruti(legacy_text)
print(f"Original (Legacy): legacy_text")
print(f"Converted (Shruti/Unicode): unicode_text")
# Output should be readable Gujarati in Shruti font.