ctx.font = fallbackFont; const fallbackWidth = ctx.measureText(testString).width;
if (!isRamdhenuInstalled()) { console.warn('Ramdhenu font not installed. Recommend: Lohit Assamese, Noto Sans Bengali'); document.body.style.fontFamily = "'Lohit Assamese', 'Noto Sans Bengali', 'Ramdhenu', sans-serif"; } Let me know your exact use case, and I’ll tailor the feature exactly to your need. assamese ramdhenu font
function isRamdhenuInstalled() { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); const testString = 'অ আ ক খ'; // Common Assamese chars const testFont = '12px Ramdhenu'; const fallbackFont = '12px monospace'; ctx.fillStyle = 'black'; ctx.font = testFont; const ramdhenuWidth = ctx.measureText(testString).width; ctx.font = fallbackFont
TechSansar.com, ICT For Media Pvt Ltd, Regd #249079/077/078, VAT #609868175.
By continuing to use this site, you agree to our cookies and privacy policies.
Here is our Do Not Track (DNT) Guide. Hosted on a VPS and uses this free PDF tool. You can also subscribe to our newsletter.
Creating tech contents for the b̶o̶t̶s̶ humans since 2009 • Team TechSansar • ICT4M with ❤ from Nepal