[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Using multiple fonts from C

I am about half way through the book “Learn C on the Macintosh” and I was trying to do a project that involved making a random draw of four bridge hands and printing them out.  I wanted to print the “Symbol” font characters for spades, hearts, diamonds, and clubs but I cannot figure out how to use more than one font in a program.  I had seen the SIOUXSettings and customization documentation in the MW C Library Ref. but it says the you need to make any changes to SIOUXSettings before any call to standard I/O functions are made.  It also says that you cannot then change the SIOUXSettings.  For my project I wanted to print something like:

North
       (Symb. for Spade)   A  K  J 10  8
       (Symb. for Heart)   8  3  2

This requires a mixture of at least two fonts (e.g., symbol and monaco) in a single SIOUX window.  
0
jpresley043097
Asked:
jpresley043097
  • 2
1 Solution
 
jpresley043097Author Commented:
How am I supposed to know how hard this question is.  I am a Newbie at this to begin with and if I had an idea how to solve the problem I would not be looking for expert advice.  Nevertheless, I do appreciate your service and I hope my 200 points does justice to the question.
0
 
PADCommented:
A SIOUX application is a VERY simple application skeleton. In fact its used as a UNIX interface (just handle inpout and output in a console).
There is no simple way to use multiple fonts in a SIOUX application because sioux create a simple Text pointer which is limited to 32767 characters and no font changes.
To use multiple fonts in a TextView you must add 'styl' ressources, and that's not possible with sioux.

Printf is an ANSI routine that only know to print out a string to the console, but as a console has no font assigned there is no way to specify a particular font and even more 2 fonts

The only way is to use QuickDraw (drawstring, drawtext, setfont and so on...)

To do that you need to make a step and create your own application without help from sioux. A good way to do that without lot of Reading (InsideMac) is to use a framework (MacApp or PowerPlant) made it simple... but before continue with "Learning C on MAc"
0
 
PADCommented:
A SIOUX application is a VERY simple application skeleton. In fact its used as a UNIX interface (just handle inpout and output in a console).
There is no simple way to use multiple fonts in a SIOUX application because sioux create a simple Text pointer which is limited to 32767 characters and no font changes.
To use multiple fonts in a TextView you must add 'styl' ressources, and that's not possible with sioux.

Printf is an ANSI routine that only know to print out a string to the console, but as a console has no font assigned there is no way to specify a particular font and even more 2 fonts

The only way is to use QuickDraw (drawstring, drawtext, setfont and so on...)

To do that you need to make a step and create your own application without help from sioux. A good way to do that without lot of Reading (InsideMac) is to use a framework (MacApp or PowerPlant) made it simple... but before continue with "Learning C on MAc"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now