Armenian - PHP and MySQL

A

Adrienne Boswell

I have a client, Wonder Years Child Care Center, that would like to include
some Armenian text on the site. I might want to add this text to a field
in a MySQL database, to be output to the page, or the text could just be on
a PHP page with includes, menu, header, etc.

What is the best way to do this? TIA.

If anyone wants to take a look at the site, it's at
[http://mywonderyears.org/general.php?pic=27#pic27]. The little boy with
the orange shirt is my son, Spane.
 
C

cwdjrxyz

I have a client, Wonder Years Child Care Center, that would like to include
some Armenian text on the site.  I might want to add this text to a field
in a MySQL database, to be output to the page, or the text could just be on
a PHP page with includes, menu, header, etc.

What is the best way to do this?  TIA.

That is what unicode is for. However likely some would not be unicode
enabled or know how to do so.

Looking at the site, the text seems to be fairly concise. If one wants
to add just a bit of Armenian, I would use the gd extension of php to
produce an image of the Armenian text. You would have to first find an
Armenian font you like and download it. Then you would use that font
set and php gd to make a small transparent image, such as a png, just
large enough to hold the text. If you just use text and the image is
not huge, the png can be fairly small in byte size and likely will not
slow your site down enough to matter.

But concerning what is best, that depends on what resources you have
and how you best like to code. You likely could do this in many ways.


If anyone wants to take a look at the site, it's at
[http://mywonderyears.org/general.php?pic=27#pic27].  The little boy with
the orange shirt is my son, Spane.
 
J

Jukka K. Korpela

Adrienne said:
I have a client, Wonder Years Child Care Center, that would like to
include some Armenian text on the site. I might want to add this
text to a field in a MySQL database, to be output to the page, or the
text could just be on a PHP page with includes, menu, header, etc.

I guess the first problem here is that PHP still does not support Unicode.
But you could present the Armenian text using character references;
hopefully PHP will act as ignorant of them, i.e. just pass them forward to
browsers. I would use a utility like BabelPad,
http://www.babelstone.co.uk/Software/BabelPad.html
to convert text into such a format, so that it would be rather smooth as
soon as you have BabelPad installed.

There's the additional problem that people may still use systems that lack
any font with Armenian letters, or an old browser (IE 6 or older) that is
not able to change font automatically when needed. You can try to alleviate
the problems by using e.g.
font-family: Arial Unicode MS, Lucida Sans Unicode
in CSS for the Armenian text, since then even an old browser might be able
to use a font that contains the characters. This is somewhat doubtful though
since e.g. the two fonts above have rather different characteristics, so if
one of them fits your overall design, the other probably won't do that very
well. Actually I might go for the more commonly available font only:
font-family: Lucida Sans Unicode
On systems that lack this font (typically, non-Windows systems), we just
have to hope that the browser is bright enough to use some other font in the
system that will do, and this usually works.

Yucca
 
J

Jukka K. Korpela

I said:
Actually I might go for the
more commonly available font only: font-family: Lucida Sans Unicode

Oops. Although Lucida Sans Unicode seems to have Armenian letters on the
system I'm using now, it apparently hasn't got them - I'm seeing characters
from a replacement font (probably Sylfaen). According to
http://www.fileformat.info/info/unicode/char/0531/fontsupport.htm
(which is fairly up-to-date), the only font that contains Armenian letters
and that you can expect to find on an average user's system is Arial Unicode
MS. It comes with Microsoft Office, so it's fairly commonly available, but
far from universal.

Yucca
 
M

Michael Fesser

..oO(Jukka K. Korpela)
I guess the first problem here is that PHP still does not support Unicode.

There's no native support yet (comes with PHP 6), but you can already
work very well with PHP and Unicode. The only thing to keep in mind is
that the string functions work on bytes instead of characters. But with
the Multibyte extension this issue can be solved quite conveniently.
But you could present the Armenian text using character references;

Not necessary.

Micha
 
A

Adrienne Boswell

I guess the first problem here is that PHP still does not support
Unicode. But you could present the Armenian text using character
references; hopefully PHP will act as ignorant of them, i.e. just pass
them forward to browsers.

Thank you, Jukka.

It would be great if y'all could test
[http://mywonderyears.org/links.php]. The link after Character and
Ethics Project should be in Armenian with Armenian characters.

I have EditPad lite installed on my system, and it has the option to
convert text. I have found that if I convert the PHP file, the data
coming out of the db will come out correctly. Since I don't speak or
read Armenian, I am looking at Armenian/English sites to compare test
phrases, and it seems to be working fine - in Opera, IE7, IE6, IE5,
Safari, and Firefox - all on Windows XP SP2.

I am not really worried about users whose browsers cannot render
Armenian text - those who are able to read Armenian will probably have
their systems set up so they can see it/hear it - those without will not
know what it says anyway (like me). I have lived in Glendale, CA (which
has a large Armenian population) for 9 years, and I am just now
beginning to learn the language - so far I can say three things, hello,
yes and thank you. It's a beginning.
 
N

Neredbojias

It would be great if y'all could test
[http://mywonderyears.org/links.php]. The link after Character and
Ethics Project should be in Armenian with Armenian characters.

If it looks like a cross between Greek and Hebrew, I got it. -Even in "View
Source" firefox 3.
I am not really worried about users whose browsers cannot render
Armenian text - those who are able to read Armenian will probably have
their systems set up so they can see it/hear it - those without will not
know what it says anyway (like me). I have lived in Glendale, CA (which
has a large Armenian population) for 9 years, and I am just now
beginning to learn the language - so far I can say three things, hello,
yes and thank you. It's a beginning.

Watch out for the lycanthropists.
 
C

cwdjrxyz

It would be great if y'all could test
[http://mywonderyears.org/links.php].  The link after Character and
Ethics Project should be in Armenian with Armenian characters.

The Armenian text works using the most recent versions of IE7,
Firefox, Seamonkey, Flock, Opera, and Safari for Windows, all on the
Windows XP OS sp3.

I have a simulator for the very old WebTV box(not the newer MSNTV2
one). It outputs text too, but it is nothing of this world - perhaps
Martian :). There likely are very few of these very old boxes still
being used, but Microsoft, the present owner, was still supporting
them a year or two ago. These boxes were mostly used by seniors - the
teens mostly departed many years ago, likely mainly because the boxes
would not download music. Also the old Amaya browser complains about
the xml not being well formed and offers to render as html. When you
so choose you get blank boxes rather than Armenian characters. The old
W3C Amaya browser was not used much by the general public and used
mainly by those who wanted to test W3C code features not then
supported by most commercial browsers.

There are sites where you can get screen shots using several older and
less common browsers, and using OSs other than Windows. I am guessing
that your page will be seen correctly by most.
 
J

Jukka K. Korpela

cwdjrxyz said:
The Armenian text works using the most recent versions of IE7,
Firefox, Seamonkey, Flock, Opera, and Safari for Windows, all on the
Windows XP OS sp3.

There's not much difference to be expected between them, as this is
primarily a font issue.

Regarding my previous note about fonts, I did not realize that Sylfaen is
shipped with Windows XP and Vista, making it rather widespread. What really
happens when you browse a page containing Armenian letters on Win XP or
Vista is that the browser does not find those letters in the fonts suggested
on the page, then checks the default fonts (as defined in browser settings)
and probably does not find them there either; and then it finally uses its
internal list of fonts and probably decides to use Sylfaen.

There's the risk that IE 6 does not get this right, unless you help it by
explicitly declaring Sylfaen for the Armenian text. It may fail the fallback
part. Testing on IE 6 is far more important in this case than playing with
Flock or Safari for example.

The real problem would be people using older Windows systems. They probably
don't have Sylfaen, but they quite often have Arial Unicode MS (since they
have Office). This raises a problem because these fonts are rather
different.

Armenian letters are often smaller than Latin letters in the same font (for
the same font size). For Sylfaen, they match the size and style of lowercase
Latin letters rather well. However, if the copy text font is Arial or
(gasp!) Verdana, Armenian letters look rather small when they have been
taken from Sylfaen (as Arial and Verdana don't contain them). And if you
combine Latin letters in Arial (or Arial Unicode MS) and Armenian letters in
Arial Unicode MS, the size difference is so big that the effect is
grotesque.

Actually I would consider using Sylfaen as the primary font for all normal
text if the text contains Armenian letters. It looks rather nice. When
Sylfaen is not available, the browser's default font would be used of
course, so maybe
body { font-family: Sylfaen, Arial Unicode MS }
would be a practical choice, but then the site would have to be tested using
both fonts, as they are so different in their nature. Of course the site
would have to be flexibly designed, not based on some font's specific
properties.
Also the old Amaya browser complains about
the xml not being well formed and offers to render as html.

Huh? The page http://mywonderyears.org/links.php is well-formed XML and it's
also valid XHTML 1.0 Strict. There's little point in reporting Amaya
problems - especially with old Amaya - anywhere outside the Amaya
development people, if there still are some.
The old
W3C Amaya browser was not used much by the general public and used
mainly by those who wanted to test W3C code features not then
supported by most commercial browsers.

So why confuse things by mentioning it at all?
There are sites where you can get screen shots using several older and
less common browsers, and using OSs other than Windows.

I'm sceptic about such services especially since this is basically a font
problem and we cannot really know how those services use fonts.

Yucca
 
A

Adrienne Boswell

There's not much difference to be expected between them, as this is
primarily a font issue.

Regarding my previous note about fonts, I did not realize that Sylfaen
is shipped with Windows XP and Vista, making it rather widespread.

I didn't know that either.
There's the risk that IE 6 does not get this right, unless you help it
by explicitly declaring Sylfaen for the Armenian text. It may fail the
fallback part. Testing on IE 6 is far more important in this case than
playing with Flock or Safari for example.

I've tested it on IE6, and it seems to be fine.
The real problem would be people using older Windows systems. They
probably don't have Sylfaen, but they quite often have Arial Unicode
MS (since they have Office). This raises a problem because these fonts
are rather different.

Yes, they certainly are. Sylfaen is much larger than Arial Unicode.
Armenian letters are often smaller than Latin letters in the same font
(for the same font size).

We could go on... it's bad enough that "web deezinerz" use tiny font
sized, imagine what would happen if they got a hold of Armenian? Oh,
the humanity!
For Sylfaen, they match the size and style
of lowercase Latin letters rather well. However, if the copy text font
is Arial or (gasp!) Verdana, Armenian letters look rather small when
they have been taken from Sylfaen (as Arial and Verdana don't contain
them). And if you combine Latin letters in Arial (or Arial Unicode MS)
and Armenian letters in Arial Unicode MS, the size difference is so
big that the effect is grotesque.
Yup.


Actually I would consider using Sylfaen as the primary font for all
normal text if the text contains Armenian letters. It looks rather
nice. When Sylfaen is not available, the browser's default font would
be used of course, so maybe
body { font-family: Sylfaen, Arial Unicode MS }
would be a practical choice, but then the site would have to be tested
using both fonts, as they are so different in their nature. Of course
the site would have to be flexibly designed, not based on some font's
specific properties.

I liked the Sylfaen font, so I changed the body to use it, with regular
Arial and sans-serif as fallback. The .armenian class bumps the
Armenian text to 105%, not too large of a difference for those with
Sylfaen font, and large enough for the Arial Unicode MS people.
I'm sceptic about such services especially since this is basically a
font problem and we cannot really know how those services use fonts.

I agree, and as I stated earlier, users who can read Armenian probably
have systems that can handle it. I doubt if Sarkis Jr. would give
Sarkis Sr. a web tv if it couldn't handle Armenian.
 
C

cwdjrxyz

Gazing into my crystal ball I observed "Jukka K. Korpela"




I didn't know that either.




I've tested it on IE6, and it seems to be fine.




Yes, they certainly are.  Sylfaen is much larger than Arial Unicode.




We could go on... it's bad enough that "web deezinerz" use tiny font
sized, imagine what would happen if they got a hold of Armenian?  Oh,
the humanity!


I liked the Sylfaen font, so I changed the body to use it, with regular
Arial and sans-serif as fallback.  The .armenian class bumps the
Armenian text to 105%, not too large of a difference for those with
Sylfaen font, and large enough for the Arial Unicode MS people.





I agree, and as I stated earlier, users who can read Armenian probably
have systems that can handle it.  I doubt if Sarkis Jr. would give
Sarkis Sr. a web tv if it couldn't handle Armenian.


Earlier in this thread I mentioned that you could use the gd extension
to make a transparent png of just about any text you wish. I wanted to
show how easy it is to do with a specific example. Go to
http://www.cwdjr.net/php/ttfAS.php and view the text for the gd php
code at http://www.cwdjr.net/php/ttfAS.php.txt . Also you need a font
file for the old Anglo Saxon font loaded on the server. Notice that
you can write the text at any angle, if desired. To get an actual png,
you can right click the image and select to download to your computer.
But make sure to change the extension to png rather than php before or
after you download. The 800 x 400 transparent png for this text image
is only about 10 KB, and you could put a lot more text of more normal
size in the same area. But you do not even have to download the image
at all. See http://www.cwdjr.net/php/ttfAStestpage.php . Right click
and view the source code and note the address of the image which is
the gd php image file we generated before and is called to bring up
the image. The advantage of this method is that you do not have to
worry what fonts a viewing browser might support, although for your
application this seems to be no great problem. I viewed the page on
all of the browsers mentioned before, and all worked fine. Thus even
Sarkis Sr. could view Armenian text on an old WebTV if he wanted
to :). If you had viewers with very old browsers for which png does
not work, you could use gif instead. Of course people can turn images
off, so one might need to state that images must be turned on to see
the Armenian.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed cwdjrxyz <[email protected]>
writing in

Earlier in this thread I mentioned that you could use the gd extension
to make a transparent png of just about any text you wish. I wanted to
show how easy it is to do with a specific example. Go to
http://www.cwdjr.net/php/ttfAS.php and view the text for the gd php
code at http://www.cwdjr.net/php/ttfAS.php.txt . Also you need a font
file for the old Anglo Saxon font loaded on the server. Notice that
you can write the text at any angle, if desired. To get an actual png,
you can right click the image and select to download to your computer.
But make sure to change the extension to png rather than php before or
after you download. The 800 x 400 transparent png for this text image
is only about 10 KB, and you could put a lot more text of more normal
size in the same area. But you do not even have to download the image
at all. See http://www.cwdjr.net/php/ttfAStestpage.php . Right click
and view the source code and note the address of the image which is
the gd php image file we generated before and is called to bring up
the image. The advantage of this method is that you do not have to
worry what fonts a viewing browser might support, although for your
application this seems to be no great problem. I viewed the page on
all of the browsers mentioned before, and all worked fine. Thus even
Sarkis Sr. could view Armenian text on an old WebTV if he wanted
to :). If you had viewers with very old browsers for which png does
not work, you could use gif instead. Of course people can turn images
off, so one might need to state that images must be turned on to see
the Armenian.

I saw the text page, and will keep it as a snippet for the future.
Thank you.

However, I never did see the image. As I finished this sentence, my
browser still has not rendered it. I am on high speed cable, tried with
both Opera and IE - IE gave up with a not available error, and Opera I
think is still trying.

I think I am going to be just fine with text. I want search engines to
be able to index it, so I think that images are not going to be a good
way to go.

Opera is still trying... oh heck, I'm going to take it out of it's
misery.

Again, thanks for the code, and thanks for looking.
 
C

cwdjrxyz

However, I never did see the image. As I finished this sentence, my
browser still has not rendered it.  I am on high speed cable, tried with
both Opera and IE - IE gave up with a not available error, and Opera I
think is still trying.

I don't know why you do not see the image nearly at once. I just
checked with several browsers including IE and Opera that you used,
and the image popped up nearly at once on Windows XP sp3 connected
with ATT/Yahoo DSL Elite with usually about 5 Mbps download speed. The
site could have been down or very slow, but it very seldom is. Let me
know if you continue to be unable to see the image. I have recently
moved to a new server at the same host so that I could upgrade from
php 4 to php 5, but of course this should have nothing to do with the
viewing browser. Some security programs now block linking from one
domain to another that is not on the same server, but that is not the
case here - everything is on the same domain.
 
C

cwdjrxyz

I don't know why you do not see the image nearly at once. I just
checked with several browsers including IE and Opera that you used,
and the image popped up nearly at once on Windows XP sp3 connected
with ATT/Yahoo DSL Elite with usually about 5 Mbps download speed. The
site could have been down or very slow, but it very seldom is. Let me
know if you continue to be unable to see the image. I have recently
moved to a new server at the same host so that I could upgrade from
php 4 to php 5, but of course this should have nothing to do with the
viewing browser. Some security programs now block linking from one
domain to another that is not on the same server, but that is not the
case here - everything is on the same domain.

I just checked the page http://www.cwdjr.net/php/ttfAS.php at
http://browsershots.org/ using both IE 7 and Opera 9.52 using the
Windows OS. Both screen shots are the same as I see on my browsers.
Thus I am at a loss to know why you do not see the image unless it is
just a temporary network problem.
 
A

Athel Cornish-Bowden

It would be great if y'all could test
[http://mywonderyears.org/links.php]. The link after Character and
Ethics Project should be in Armenian with Armenian characters.

It works fine in MacOS 10.4 with either Safari or iCab. By "works fine"
I mean the Armenian characters are certainly Armenian characters;
whether they are the _right_ Armenian characters is, of course, another
matter.
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top