|
Posted by Cogito on 03/29/07 08:02
On Thu, 29 Mar 2007 16:44:19 +1000, dorayme
<doraymeRidThis@optusnet.com.au> wrote:
>In article <ljim039lvpu1302kak1ijlmb7hai8t0gu8@4ax.com>,
> Cogito <nospam@nospam.nospam> wrote:
>
>> >
>> >> For a chess puzzle that I'm working on at the moment, I need to
>> >> display a chessboard with several queens on it. The chessboard is an
>> >> html table and the queens are represented by the character '*'.
>> >> This part is now working well.
>> >>
>> >> In order to embellish the appearance of the chessboard I searched the
>> >> internet and found a set of free chess fonts.
>> >>
>> >> My problem is that I don't know how to select the queen character from
>> >> the chess fonts to replace the '*'. Any help would be greatly
>> >> appreciated.
>> >
>> >If you want a chess puzzle (and the graphic is not so bad), look
>> >at:
>> >
>> ><http://members.optushome.com.au/droovies/binHassad/missingKing.ht
>> >ml>
>> >
>> >If it is scaling you want, (a table will only scale the non
>> >images normally anyway), there is a simple way and reasonably
>> >good in many modern browsers. Prepare a reasonably big graphic
>> >and give it dimensions in %s in css not in the html.
>>
>>
>> All I'm asking is for a code example of how do I display the queen
>> character. When I use the font manager, I can see the various chess
>> pieces characters, and I'm sure it is quite simple, but, how do I get
>> them displayed?
>
>If you are asking how to get a browser to display a particular
>font, you can do it like this:
>
>td {font-family: "Chess"}
>
>And you type in the character that displays the queen. I am using
>"Chess" here to name the font you have recently found, I have no
>idea about it.
>
>Are you expecting your website internet visitors to have a
>special font that looks like a chess Queen? This is not so easy
>or possible. So, what I am encouraging you to say is more about
>what you are doing and why. Why would a straight out graphic be
>inappropriate to your needs?
>
>If someone does not have that font - and there is nothing you can
>specify as fallback after "Chess" that could at all help.
>Normally, one puts in one's preferences like Geneva and at the
>end of a comma delimited list, put in a generic: ,sans-serif
As you suggested, I have also specified the font name "Chess" and
determined what character is the equivalent of the queen, and used it.
It worked and I was quite pleased until I realised, as you have
indicated that other users wuould not have access to this font. So I'm
back to square one of using an "*" to represent a queen.
I wrote Javascript program to solve the "8 Queens problem" of placing
8 queens on a chessboard so that no queen threatens the others. Before
displaying each solution (and there are 92 in total) I keep in memory
an array of 8x8 each containing either an " " character or the
"queen" character. I then proceed to map this array into the table.
It would be nice to have this one "queen" character without the need
to install the whole font.
[Back to original message]
|