វិធីសាស្ត្របង្កប់ខ្មែរយូនីកូដក្នុងជូម្ល៉ាដោយសង្ខេប៖
ខាងក្រោមនេះខ្ញុំនឹងបង្កប់ពុម្ពអក្សរខ្មែរយូនីកូដឈ្មោះ Kh Battambang និង Kh Metal Chrieng ចូលក្នុងជូម្ល៉ា ដើម្បីអោយអ្នកទស្សនាដែលកុំព្យូទ័ររបស់ពួកគាត់ទោះជាគ្មានពុម្ពអក្សរខ្មែរយូនីកូដក៏អាចមើលអក្សរខ្មែរលើតំបន់បណ្ដាញ ឬគេហទំព័ររបស់យើងបានដែរ។
១. បង្កើតឯកសារ CSS ឈ្មោះ fonts.css មានមាតិកាដូចខាងក្រោម៖
Code:
/*For Internet Explorer*/
@font-face {
font-family: Kh Metal Chrieng;
font-style: normal;
font-weight: normal;
src: url(kh-metal-chrieng.eot);
}
@font-face {
font-family: Kh Battambang;
font-style: normal;
font-weight: normal;
src: url(kh-battambang.eot);
}
/*For Firefox*/
@font-face {
font-family: Kh Metal Chrieng;
font-style: normal;
font-weight: normal;
src: url(kh-metal-chrieng.ttf);
}
@font-face {
font-family: Kh Battambang;
font-style: normal;
font-weight: normal;
src: url(kh-battambang.ttf);
}
រក្សាឯកសារនេះទុកក្នុង៖ ថតជូម្ល៉ាអ្នក\templates\template_name\css
template_name ជាឈ្មោះពុម្ពជូម្ល៉ារបស់អ្នក។ ឧទាហរណ៍៖ rhuk_milkyway, ja_purity,beez ដែលជាឈ្មោះពុម្ពឥតគិតថ្លៃភ្ជាប់មកជាមួយជូម្ល៉ាស្រាប់ពេលអ្នកបានដំឡើង។
ឧទាហរណ៍ បើ "km-kh" ជាឈ្មោះនៃពុម្ពរបស់ខ្ញុំ យើងបាន "ថតជូម្ល៉ាអ្នក\templates\km-kh\css\fonts.css"
២. ផ្ទុកពុម្ពអក្សរឡើងទៅចូលក្នុងថត "ថតជូម្ល៉ាអ្នក\templates\km-kh\css\"
ក) kh-metal-chrieng.ttf kh-battambang.ttf (សម្រាប់ Firefox )
អាចរកបាននៅ
លើបណ្ដាញ ប៉ុន្តែ កុំច្រឡំជាមួយ Khmer OS Battambang ឬ Khmer OS Metal Chrieng ឲ្យសោះ។
ខ) kh-metal-chrieng.eot kh-battambang.eot (សម្រាប់ Internet Explorer)
.eot បង្កើតឡើងដោយប្រើ
WEFT 3.2 វិធីប្រើ
សូមអាន៣. បន្ថែមកូដខាងក្រោម
Code:
<link href="<?php echo $template_path; ?>/css/fonts.css" rel="stylesheet" type="text/css" media="screen" />
ក្នុងចន្លោះ <head></head> ទៅក្នុង index.php នៃថតពុម្ពរបស់អ្នក។
នោះខ្ញុំត្រូវបញ្ចូលកូដខាងលើទៅក្នុង "ថតជូម្ល៉ាអ្នក\templates\km-kh\index.php"។
៤. កែបណ្ដាកូដ css ទាំងឡាយរបស់ពុម្ពជូម៉្លាអ្នក ដែលប្រើ font-family ឲ្យប្រើគ្រួសារពុម្ពអក្សរ Kh យូនីកូដខាងលើ
ឧទាហរណ៍ ក្នុង "ថតជូម្ល៉ាអ្នក\templates\km-kh\css\template.css"
Code:
#jsn-master {
font-family: Arial, Helvetica, sans-serif;
font-size: 75%;
line-height: 1.5;
background: #172534 url(../images/master-bg.jpg) repeat-x top left;
}
កែទៅជា
Code:
@import url("fonts.css");
#jsn-master {
font-family: "Kh Battambang", Arial, Helvetica, sans-serif, "Khmer OS System";
font-size: 75%;
line-height: 1.5;
background: #172534 url(../images/master-bg.jpg) repeat-x top left;
}
ជូនពរអ្នករីករាយក្នុងការបង្កប់ពុម្ពអក្សរយូនីកូដខ្មែរក្នុងជូម្ល៉ា!
------------------
This topic sounds like "How to embed Khmer Unicode in Joomla"
Let me give you a brief answer as follow:
Below we are going to embed "Kh Battambang" and "Kh Metal Chrieng" fonts into Joomla site, so that your site visitors are able to see read your Khmer Joomla site without having any Khmer Unicode font on their computer.
1. Create a CSS file name it as fonts.css and input the following code:
Code:
/*For Internet Explorer*/
@font-face {
font-family: Kh Metal Chrieng;
font-style: normal;
font-weight: normal;
src: url(kh-metal-chrieng.eot);
}
@font-face {
font-family: Kh Battambang;
font-style: normal;
font-weight: normal;
src: url(kh-battambang.eot);
}
/*For Firefox*/
@font-face {
font-family: Kh Metal Chrieng;
font-style: normal;
font-weight: normal;
src: url(kh-metal-chrieng.ttf);
}
@font-face {
font-family: Kh Battambang;
font-style: normal;
font-weight: normal;
src: url(kh-battambang.ttf);
}
This "fonts.css" stored at "your_joomla_root\templates\template_name\css".
template_name is the name of your Joomla template. eg. rhuk_milkyway, ja_purity,beez are free joom templates when you first install Joomla.
Here, example "km-kh" is the name of our default template then we get "your_joomla_root\templates\km-kh\css".
2. Upload the two fonts into "your_joomla_root\templates\km-kh\css" folder.
a) kh-metal-chrieng.ttf and kh-battambang.ttf (for Firefox, Chrome ... )
Available to download from
Website But please do not confuse with Khmer OS Battambang or Khmer OS Metal Chrieng at all.
b) kh-metal-chrieng.eot and kh-battambang.eot (Only for Internet Explorer)
.eot files were created by using
WEFT 3.2 How to use
Please Read3. Add the following codes:
Code:
<link href="<?php echo $template_path; ?>/css/fonts.css" rel="stylesheet" type="text/css" media="screen" />
between <head></head> into index.php of your Joomla template.
mean add the above code into "your_joomla_root\templates\km-kh\index.php"។
4. Modify all of your CSS files of your template which used font-family to use Kh Unicode fonts mentioned above.
eg. in "your_joomla_root\templates\km-kh\css\template.css"
Code:
#jsn-master {
font-family: Arial, Helvetica, sans-serif;
font-size: 75%;
line-height: 1.5;
background: #172534 url(../images/master-bg.jpg) repeat-x top left;
}
Change to:
Code:
@import url("fonts.css");
#jsn-master {
font-family: "Kh Battambang", Arial, Helvetica, sans-serif, "Khmer OS System";
font-size: 75%;
line-height: 1.5;
background: #172534 url(../images/master-bg.jpg) repeat-x top left;
}
Wish you all success embedding Khmer Unicode fonts into Joomla!