Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,939 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,420 people online right now. Registration is fast and FREE... Join Now!




error in displaying Arabic font in code

 
Reply to this topicStart new topic

error in displaying Arabic font in code

amir2008amir
6 Jan, 2008 - 08:49 PM
Post #1

New D.I.C Head
*

Joined: 6 Jan, 2008
Posts: 2

Hello,
In c++ text mode arabic fonts displayed correctly , but when i am using graphic mode It displayed as a strange symbols.
note:
I am using Turboc c++ v.3
My dos operating system supporting Arabic
I am a beginer.

can anyone help me ?


User is offlineProfile CardPM
+Quote Post

nirvanarupali
RE: Error In Displaying Arabic Font In Code
6 Jan, 2008 - 09:28 PM
Post #2

D.I.C Stomach
Group Icon

Joined: 1 Aug, 2007
Posts: 995



Thanked: 4 times
Dream Kudos: 375
My Contributions
Please post your codes.
And post your code like this:
code.gif
User is offlineProfile CardPM
+Quote Post

amir2008amir
RE: Error In Displaying Arabic Font In Code
6 Jan, 2008 - 09:45 PM
Post #3

New D.I.C Head
*

Joined: 6 Jan, 2008
Posts: 2

CODE

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

void checkerrors(void);

int main(void)
{
   int gdriver = DETECT, gmode;
   int userfont;
   int midx, midy;

initgraph(&gdriver, &gmode, "");

   midx = getmaxx() / 2;
   midy = getmaxy() / 2;

  
   checkerrors();
userfont = installuserfont("Sans.CHR");

   checkerrors();

settextstyle(userfont , HORIZ_DIR, 4);

// The following is An Arabic word :

outtextxy(midx, midy, " الله");
getch();
   closegraph();
   return 0;
}



void checkerrors(void)
{
   int errorcode;

   errorcode = graphresult();
   if (errorcode != grOk)
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1);
   }
}



This post has been edited by amir2008amir: 6 Jan, 2008 - 09:46 PM
User is offlineProfile CardPM
+Quote Post

nirvanarupali
RE: Error In Displaying Arabic Font In Code
7 Jan, 2008 - 09:49 PM
Post #4

D.I.C Stomach
Group Icon

Joined: 1 Aug, 2007
Posts: 995



Thanked: 4 times
Dream Kudos: 375
My Contributions
My advice is, do not anymore use graphics.h header, that is too old and the recent compilers which is ISO standard does not support graphics.h and even recent OS.

Try to revise your program without using graphics.h.

You will receive less help if you are programming in the old way, and using a compiler which is too old while others here are the updated.

I am using Borland 5x. which supports C++ ISO.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 04:38PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month