Jump to content

how to write a c++ program which output should in my national langauge(preeti font)

- - - - -

  • Please log in to reply
8 replies to this topic

#1
uselesme

uselesme

    Newbie

  • Members
  • Pip
  • 5 posts
i want to write a small program using c++. but i want to display its output in my own language (preeti font). please help me.
eg.
#include<iostream.h>
void main()
{
cout<<" HELP ME";
}

how i can change this HELP ME in preeti font

Edited by Alexander, 14 April 2011 - 06:25 PM.
(Added code tags, # button)


#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I do not believe there is a portable way to do this in C++, as I am unaware of what your platform or compiler is. You can include wchar.h and use wscanf and wprintf:

 wprintf(L"(something in your language here)");

Three notes are:

  • C++ does not know what a font is, you can only insert a character mapped to a code point, such as with UTF-16.
  • You must append L before each string literal that is wide, including the formatting specifiers in the wprint or wscanf functions, i.e, L"%s".
  • Your console may not support wide character format, such as the standard Windows console without modification.

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
uselesme

uselesme

    Newbie

  • Members
  • Pip
  • 5 posts
i m using turbo c++ 3.0.

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Turbo C++ 3.0 was released in 1991, you may wish to get a compiler that at least conforms to C++ 1998 standards.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
uselesme

uselesme

    Newbie

  • Members
  • Pip
  • 5 posts
okk. which one is the best c++ compiler now?

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
If you are on Windows, you may wish to get Visual C++. Their compiler includes some nice support for wide characters in C++.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
uselesme

uselesme

    Newbie

  • Members
  • Pip
  • 5 posts
okkk thanks. can it helps me to show output in chinese language.

#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Depending on the support of your compiler, either of the two of these may work:
 wprintf(L"汉语/漢語\n");
and
std::wcout << L"汉语/漢語" << std::endl;
It is still dependent on your terminal capabilities.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#9
uselesme

uselesme

    Newbie

  • Members
  • Pip
  • 5 posts
Thanks a lot. hope this will work on my program.:)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users