imagefontwidth() PHP-এ একটি বিল্ট-ইন ফাংশন যা নির্দিষ্ট ফন্টে একটি ক্যারেক্টারের পিক্সেল প্রস্থ পেতে ব্যবহৃত হয়।
সিনট্যাক্স
int imagefontwidth(int $font)
প্যারামিটার
imagefontwidth() শুধু একটি প্যারামিটার নেয়, $font। এটি ফন্ট ভ্যালু ধারণ করে। $font ভ্যালুগুলো ১, ২, ৩, ৪, এবং ৫ হতে পারে বিল্ট-ইন ফন্টের জন্য অথবা কাস্টম ফন্টের জন্য imageloadfont() ফাংশন ব্যবহার করে।
রিটার্ন ভ্যালু
imagefontwidth() ফন্টের পিক্সেল প্রস্থ রিটার্ন করে।
উদাহরণ ১
<?php // ফন্ট প্রস্থের ভ্যালু ১ থেকে ৫ পর্যন্ত পরিবর্তন করা যায়। echo 'Font width: '.imagefontwidth(3); ?>
আউটপুট
Font width: 7
উদাহরণ ২
<?php // ফন্ট প্রস্থ ১ থেকে ৫ সেট করুন echo 'Font width for the font value 1 is' .imagefontwidth(1).'<br>'; echo 'Font width for the font value 2 is' .imagefontwidth(2).'<br>'; echo 'Font width for the font value 3 is' .imagefontwidth(3).'<br>'; echo 'Font width for the font value 4 is' .imagefontwidth(4).'<br>'; echo 'Font width for the font value 5 is' .imagefontwidth(5).'<br>'; ?>
আউটপুট
Font width for the font value 1 is 5 Font width for the font value 2 is 6 Font width for the font value 3 is 7 Font width for the font value 4 is 8 Font width for the font value 5 is 9