HTML file එකක සිංහල font පෙන්නන්නෙ කොහොමද ?

Mr.Mark

Active member
  • Jul 23, 2018
    162
    171
    43
    සිංහල වලින් හදපු simple html ෆයිල් එකක් තියෙනවා. ඒක android mobile phone එකට දාලා බැලුවම සිංහල ෆොන්ට්ස් පෙන්නන්නෙ නෑ(අපබ්‍රංශ අකුරු ටිකක් පෙන්නන්නෙ සිංහල අකුරු වෙනුවට).
    ඒක හදාගන්නෙ කොහොමේ ?

    code එක :

    html ෆයිල් එකට mobile phone එකේ පේන විදිහට Noto Sans Sinhala font එක දාගන්නයි ඕනෙ.

    https://fonts.google.com/noto/specimen/Noto+Sans+Sinhala
     

    Amith0424

    Well-known member
  • Oct 27, 2010
    14,286
    24,466
    113
    ℒ𝓸𝓬𝓪𝓽𝓲𝓸𝓷
    CSS:
    @font-face {
        font-family: "Noto Sans Sinhala";
        src: url("../fonts/Noto_Sans_Sinhala.ttf") format("truetype");
    }
    
    body {
        font-family: 'NotoSansSinhala',sans-serif;
    }
    or
    Code:
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:[email protected]&display=swap" rel="stylesheet">
    
    <style>
    body {
        font-family: 'NotoSansSinhala',sans-serif;
    }</>
    මෙහෙම දාල body එකට දාගන්න උඩ වගේ.
     

    Amith0424

    Well-known member
  • Oct 27, 2010
    14,286
    24,466
    113
    ℒ𝓸𝓬𝓪𝓽𝓲𝓸𝓷
    ආ හරි හරි . වැඩේ හරි ගියා. :love:
    <head> එක ඇතුලට ,

    <meta charset="UTF-8">
    <link href='https://fonts.googleapis.com/css?family=Noto Sans Sinhala' rel='stylesheet'/>

    ඔය දෙක දාලා , <body> එක ඇතුලට

    body {font-family: Arial, Noto Sans Sinhala;}

    එක දැම්මා.
    full link දාල preconnect tag දෙකත් දාගන්න මචන්.