Need help with font selection

C

Cogito

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.
 
D

dorayme

Cogito said:
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.
 
C

Cogito

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?
 
D

dorayme

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?[/QUOTE]

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

But, Cogito, please don't worry about all this stuff, just solve
the problem I gave you.
 
C

Cogito

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?

Wel, with some trial and error I got it to work. First I simply
specified the new font and then tries using various letter until it
turned out the 'q' is replaced bt the queen character...
Is there a way of determinig what letter corresponds to what in a new
font?
 
S

scripts.contact

First I simply
specified the new font and then tries using various letter until it
turned out the 'q' is replaced bt the queen character...
Is there a way of determinig what letter corresponds to what in a new
font?

Start-Run-charmap
Select Font Anme
Copy the character you want and paste it somewhere (e.g. in Notepad)
 
D

dorayme

dorayme said:
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


Sorry... don't know what happened re subject? I will repost.
 
D

dorayme

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?[/QUOTE]

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
 
C

Cogito

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[/QUOTE]


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 "&nbsp;" 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.
 
A

Andy Dingley

For a chess puzzle that I'm working on at the moment, I need to
display a chessboard with several queens on it.
found a set of free chess fonts.

Is this a "web page" or a "local HTML page" ?

If it's a page that's on your computer(s) and only needs to work
there, then this is easy to do with a font. If it's for the public
web, then I might regard it as too difficult and would use images
instead.

I assume you've got a font like Chess Cases
<http://www.enpassant.dk/chess/downl/cases.zip>
This represents each piece as a simple mnemonic lower-case letter so
that "k" is a white king, "l" (next letter after k) a black king, "o"
are pawns etc. Authoring the HTML to use this is easy and the CSS
just needs font-family: 'Chess Cases'; I don't know how consistent
this naming is among other chess fonts.

The drawback is that this approach needs the font to have been
installed on the user's computer _beforehand_. OK for yourself or some
friends, possibly usable on the web for keen users (provide a link to
download the font) but it's not a general solution for casual web
users.

The sad thing is that CSS doesn't have much practical ability to
select arbitrary typefaces, or to download new fonts as required.
There's a tool called WEFT that can do this, but it's M$oft only and
has many problems in its use. On the whole I'd avoid it.

If you want to make a really general solution, then I'd use images.
This is some minor work in the HTML and CSS, but nothing too
difficult. You can make your own images using one of these fonts (I'd
use Inkscape as a tool to do this, which is a worthwhile free drawing
package to learn about anyway)


I attach your previous chessboard example, re-worked to use this font.
Install it beforehand

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd" >
<html lang="en" ><head><title>Chessboard</title>

<style type="text/css" >
body {
background-color: #f5deb3;
color: #000080;
}

table.chessboard {
margin: 2em auto;
font-family: arial, sans-serif;
font-size: 1em;
text-align:center;
font-weight: bold;
}

table.chessboard td {
background-color: #eeeedd;
color: #000000;

width: 2em;
height: 2em;

font-family: 'Chess Cases';
font-size: 2em;
}

table.chessboard td.text {
font-family: sans-serif;
font-size: 0.67em;
}

table.chessboard td.dark {
background-color: #b0c4de;
}

</style>
</head><body>

<table class="chessboard" border="0" cellspacing="0" cellpadding="0" <tr>
<td class='dark'>t</td><td >m</td><td class='dark'>v</td><td >l</
td><td class='dark'>w</td><td >v</td><td class='dark'>m</td><td >t</
td>
</tr>
<tr>
<td >o</td><td class="dark" >o</td><td >o</td><td class="dark" >o</
td><td >o</td><td class="dark" >o</td><td >o</td><td class="dark" >o</
td>
</tr>
<tr>
<td class="dark" ></td><td ></td><td class="dark" ></td><td ></
td><td class="dark" ></td><td ></td><td class="dark" ></td><td ></td>
</tr>
<tr>
<td >x</td><td class="dark" ></td><td ></td><td class="dark" ></
td><td ></td><td class="dark" ></td><td ></td><td class="dark" ></td>
</tr>
<tr>
<td class="dark" ></td><td ></td><td class="dark" ></td><td ></
td><td class="dark" ></td><td ></td><td class="dark" ></td><td ></td>
</tr>
<tr>
<td ></td><td class="dark" ></td><td ></td><td class="dark" ></
td><td ></td><td class="dark" ></td><td ></td><td class="dark" ></td>
</tr>
<tr>
<td class='dark'>p</td><td >p</td><td class='dark'>p</td><td >p</
td><td class='dark'>p</td><td >p</td><td class='dark'>p</td><td >p</
td>
</tr>
<tr>
<td >r</td><td class="dark" >n</td><td >b</td><td class="dark" >k</
td><td >q</td><td class="dark" >b</td><td >n</td><td class="dark" >r</
td>
</tr>
</table>

</body></html>
 
C

Cogito

Is this a "web page" or a "local HTML page" ?

Come to think of it, this is mainly a "local HTML page". Well, I may
use it to impress some visiting friends but that's about it.

I have just replaced the measly '*' with the number 8 in "Windings 2".
That looks good and will do for when I send it to a friend.
I assume you've got a font like Chess Cases
<http://www.enpassant.dk/chess/downl/cases.zip>

You are right. That is the very font that I found. Your chessboard
worked straight away.

I thank you for your comments and explanations.
 
J

Jukka K. Korpela

Scripsit Cogito:
Come to think of it, this is mainly a "local HTML page". Well, I may
use it to impress some visiting friends but that's about it.

Then you might just as well impress people by doing things _right_.

Using fancy, Wingdings-like font is the wrong way - "fontistic fantasy".
When you have the letter "x" in an HTML document's content, it _means_ the
letter "x". A browser should actually refuse to display it using a
Wingdings-like font, since a font should only be used for _characters_
actually included into the font. See
http://alis.isoc.org/web_ml/html/fontface.en.html
(The same arguments apply when using CSS for the purpose.)

The right way is to use an image, with an adequate alt text (e.g., alt="D",
depending on language), or to use the Unicode characters for chess pieces:
♕ white queen
♛ black queen

Support to them in fonts is not widespread, see
http://www.fileformat.info/info/unicode/char/2655/fontsupport.htm
but you can install a suitable font for your local use, and for other users,
it is sufficient for them to have _any_ font supporting the character(s)
used. Besides, many of them already have such a font, since Arial Unicode MS
is one of them and it is normally installed when you install some MS Office
software, like MS Word.

Since IE isn't very clever in using fonts, you should probably include a
rule like
td { font-family: Arial Unicode MS, Code2000; }
into your style sheet (assuming all of your table cells contain chess piece
characters only).
 
E

Ed Seedhouse

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?

You don't, not unless each user of the page has your chess font
installed. If you take a look at some chess pages you'll find that they
sent small graphics for the pieces.
 
B

Ben C

I give up.

I figure the white king must have been on either b3 or c2 since as
things stand the black king is in check. The white bishop attacking it
can only have got where it is along that same diagonal, and the black
king can't have moved into check. So something must have moved off that
diagonal opening the attack.

The white king couldn't have been on c2, since there is no way two kings
can end up on adjacent squares-- to move a king next to another king is
to move it into check, which is illegal.

That leaves b3, from where it moved to either a3 or c3 out of check
itself and checking black. But it is not possible for it to have got
into the situation on b3 attacked by both the rook and bishop in the
first place, since they can't both have got there in a single move.
 
D

dorayme

Ben C said:
I give up.

I figure the white king must have been on either b3 or c2 since as
things stand the black king is in check. The white bishop attacking it
can only have got where it is along that same diagonal, and the black
king can't have moved into check. So something must have moved off that
diagonal opening the attack.

The white king couldn't have been on c2, since there is no way two kings
can end up on adjacent squares-- to move a king next to another king is
to move it into check, which is illegal.

That leaves b3, from where it moved to either a3 or c3 out of check
itself and checking black. But it is not possible for it to have got
into the situation on b3 attacked by both the rook and bishop in the
first place, since they can't both have got there in a single move.


Am reluctant to blurt it out. My many enemies and detractors are
absolutely dying to know.

<g>

So, send me an email so I can reply, subject it "Missing King"
without quotes and I will be happy to give you a position and
indicate the falling off point and perhaps a short note or two.
Actually, I better get out my board and work it out again, it is
not obvious! Been ages since I solved it. I made an animated gif
of my solution once to show it in action. For the life of me, I
do not know where it might be. Probably on a CD or old HD,
hundreds of which are lying about the place.
 
C

Cogito

The right way is to use an image, with an adequate alt text (e.g., alt="D",
depending on language), or to use the Unicode characters for chess pieces:
♕ white queen
♛ black queen

Thank you for trying to help, but I don't quite understand what I'm
supposed to do.

How can I make use of the "♕" white queen character?
I need it to something like:
Square = "&#x2655";
Is this correct?

Can you please show a simple example of what needs to be coded in
order to assign the queen to a variable?
 
D

dorayme

Cogito said:
Thank you for trying to help, but I don't quite understand what I'm
supposed to do.

How can I make use of the "♕" white queen character?
I need it to something like:
Square = "&#x2655";
Is this correct?

Can you please show a simple example of what needs to be coded in
order to assign the queen to a variable?

You just put &#x2655 where you want a queen to appear. If it is
in a paragraph, then

<p>Here is a picture of a queen: &#x2655. And here is another
one: &#x2655. And yet another: &#x2655. Here are 3 in a row:
&#x2655 &#x2655 &#x2655</p>

If in a table cell, then similar...

Have you solved the problem of The Missing King yet?
 
C

Cogito

You just put &#x2655 where you want a queen to appear. If it is
in a paragraph, then

<p>Here is a picture of a queen: &#x2655. And here is another
one: &#x2655. And yet another: &#x2655. Here are 3 in a row:
&#x2655 &#x2655 &#x2655</p>

Looks simple enough but it does not work here... what is missing?
Have you solved the problem of The Missing King yet?

Still working on this one.
 
J

Jukka K. Korpela

Scripsit Cogito:
Looks simple enough but it does not work here... what is missing?

You didn't do as _I_ wrote (and as HTML specifications do in their
examples):

By the specifications, the semicolon is not always required (e.g., in the
occurrences in the above markup), but it has always been good practice in
HTML to include it. For some odd reason, IE 7 decided to refuse to recognize
&#x2655 without the semicolon. Moreover, the semicolon _is_ required in
XHTML, so maybe you used XHTML on an XHTML-capable browser.

Moreover, you may have missed the font issue I mentioned. So if you have
<td>♕</td>
it's useful (for IE) to have
td { font-family: Arial Unicode MS, Code2000; }
in your stylesheet.
 
C

Chris F.A. Johnson

That is taken (uncredited) from "Chess Mysteries of the Arabian
Knights" by Raymond Smullyan.
I give up.

I figure the white king must have been on either b3 or c2 since as
things stand the black king is in check. The white bishop attacking it
can only have got where it is along that same diagonal, and the black
king can't have moved into check. So something must have moved off that
diagonal opening the attack.

The white king couldn't have been on c2, since there is no way two kings
can end up on adjacent squares-- to move a king next to another king is
to move it into check, which is illegal.

That leaves b3, from where it moved to either a3 or c3 out of check
itself and checking black. But it is not possible for it to have got
into the situation on b3 attacked by both the rook and bishop in the
first place, since they can't both have got there in a single move.

What could the last three moves (White, Black, and White) have been?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top