Click here to Skip to main content
15,888,289 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I have some document in Joy font some in anmol font and some in some other font, all are in punjabi, I want to merge all these documents into single font u can say want to convert then into unicode format how i can achieve this.
Thanks

What I have tried:

I got a reference site Convert Text - Online Punjabi Font Converter[^] which is working site as I want but I am not able to get the code
Posted
Updated 26-Mar-16 20:52pm
v2
Comments
Sergey Alexandrovich Kryukov 26-Mar-16 13:40pm    
"merge all these documents into single font" makes no sense at all. Documents are documents, fonts are fonts.

Now, it's not clear what are you talking about. If you tagged ASP.NET and jQuery, it would be clear. But how it can possibly related to Java? I suspect that you might have no idea of some of the languages and technologies you mentioned.

Besides, there is no such thing as "Unicode format". Why anything should "convert"? I'm sure you don't understand what Unicode, encodings and other such things do. All the technologies you mention are totally based on Unicode, so there is nothing to "convert". And, on the Web page, you can also change the font for different elements using CSS.

—SA
Member 3015492 26-Mar-16 13:55pm    
sir,
punjab can be written in multiple fonts, for example in "joy font r=ਗ" in "Akhar font g=ਗ" i have to read the document using any language and convert them into unicode
Sergey Alexandrovich Kryukov 26-Mar-16 14:29pm    
Everything can be written in multiple fonts. Do yourself a big favor, learn the stuff I mentioned in my answer.
"Convert to Unicode" is absurd; you still don't understand anything.

Wait a minute, I forgot one important point in my answer...
...Done, please see the update to my answer, after [EDIT].

—SA

1 solution

Please see my comment to the question. Essentially, it contains the answer, and the essence of this answer is: there is no such problem.

All your problem is: you just need some education. In this case, you have to learn just two additional things: 1) what is Unicode and what it does, how it's different from "encoding", 2) CSS.

Then you will simply enter all your text on the page in UTF, by the standard de-facto, UTF-8. You need to learn how is it related to Unicode:
FAQ - UTF-8, UTF-16, UTF-32 & BOM[^],
Unicode Consortium[^],
Unicode — Wikipedia, the free encyclopedia[^],
Universal Coded Character Set — Wikipedia, the free encyclopedia[^].

You enter in the same encoding all your Web page content, with no exclusion. UTF-8 is compatible with ASCII and ANSI, anyway. It's very important to prescribe the encoding in HTTP-EQUIV:
HTML
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   </head>

<!-- ... -->

</html>


Now, let's see you need to use two different types of HTML element: "Joy" and "Punjabi". I'm sure what "Joy" is and cannot it be the same as Punjabi, but there are two different writing systems used by Punjabi: Gurmukhī and Shahmukhi, both supported by Unicode. This is what you have to care about, not the language using the writing systems:
Gurmukhī alphabet — Wikipedia, the free encyclopedia[^],
Shahmukhi alphabet — Wikipedia, the free encyclopedia[^].

I'm not sure, but let's assume that "Joy" doesn't support any of these alphabets. Then you simply need to change the font for those different types of elements, which are called "classes" in CSS:
CSS
div.joy { font-family: "..."; }
/* hopefully, font families for Punjabi can come by default */
/* otherwise, there can be more classes */

and then in HTML you can have
HTML
<div class="joy"> <!-- ... --> </div>

And so on…

[EDIT #1]

I almost forgot: you cannot assume that all you users have all the exotic fonts installed, like your "joy". So, it comes to one unpleasant chore: you also may need to embed some fonts themselves in CSS. See, for example, Using @font-face | CSS-Tricks[^].

See also: CSS Fonts Module Level 3[^].

[EDIT #2]

See also my past answers on the topic:
How do i convert from ascii to unicode in C#[^],
get UTF-8 char in WSDL NuSoap[^],
unicode chr in arabic lang[^],
Ascii to Unicode Converter[^].

Also, one related answer, about the use of Microsoft Keyboard Creator and the possibility to craft any keyboard layout: Problem in typing in Hindi and english[^].

I provided some conceptual explanation of something fundamental about Unicode, something which perhaps wasn't properly explained:

About Unicode as one-to-one correspondence between abstract notions:
Unicode is a standard which defines formal one-to-one correspondence between "characters" understood as some cultural categories abstracted from their exact graphics (for example, Latin "A" and Cyrillic "А" are different characters, you can test it by using text search on this paragraph) and integer numbers, abstracted from their computer presentation like size and endianess. Despite of common wrong opinion, this is not 16-bit code as the range of "code points" presently standardized by Unicode goes far beyond the range which can fit in 16 bits (called Base Multilingual Plane, BMP). As there are different integer types, there are several different ways to represent Unicode text called UTFs.


One more view, with historical perspective, by Joel Spolsky: http://www.joelonsoftware.com/articles/Unicode.html[^].

—SA
 
Share this answer
 
v6
Comments
Sascha Lefèvre 26-Mar-16 15:54pm    
My 5.
Sergey, I read somewhere that you keep a database of your past answers and I assume you have categorized them somehow by topic. May I ask you to give me a list of links to your answers on character sets, encodings and "related stuff"? I need to improve my knowledge in this area too.. :)
Sergey Alexandrovich Kryukov 26-Mar-16 16:45pm    
Than you, Sascha.

Unfortunately, I'm not so organized with my past answers as you assumed. I only keep a set of plain text files with links, not much categorized, and search them by text editor search (my own), but I do keep the files in the Subversion database. So far, it works for me, but could be organized better. (I'm trying to work as light-weight as I can, too.)

On this topic, all I have is the set of some of my past answers, and those answers reference everything else. If I provide this list, you will have to scan through each, with all duplicate references. Please take it with understanding: I recorded not so many of them.

—SA
Sergey Alexandrovich Kryukov 26-Mar-16 17:09pm    
Done. I've added extra information into the same very answer, under [EDIT #2].

Please understand that I really appreciate your request, but this is all I have, so please exercise some patience.

And what to do now? Now I'll have to add this answer to my record, as this is the only one where I referenced all essential I had on related topic before... :-)

—SA
Sascha Lefèvre 26-Mar-16 19:14pm    
Hehe :-)
Of course you have my understanding, Sergey. Thank you very much for adding what you had available. I'll take a look at it!
Sascha
Sergey Alexandrovich Kryukov 26-Mar-16 20:05pm    
You are more than welcome. :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900