<div dir="auto">Thanks!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 5, 2020, 9:45 PM Lucien Gentis <<a href="mailto:lucien.gentis@waika9.com">lucien.gentis@waika9.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p>Hello Dheeraj,</p>
I think fontconfig.h does not provide any function calculating
string or character width.<br>
But Xft.h does.<br>
You extract pertinent data from your FcPattern like family, size,
slant, weight and for you spacing which must be 0.<br>
Then you open your font like this (example) :
<p>XftFont * font=XftFontOpenName(display,screen,newFont);</p>
<p>where newFont could be "Liberation
Sans-12:bold:roman:proportional"</p>
<p>You can now calculate the width of the character 'm' via this
command :<br>
</p>
XGlyphInfo glyphInfo;<br>
XftTextExtentsUtf8 (display,font,"m",1,&glyphInfo);
<p>glyphInfo.width contains the width of your character<br>
</p>
<p><br>
</p>
<div>Le 05/02/2020 à 10:48, Dheeraj Yadav a
écrit :<br>
</div>
<blockquote type="cite">
<div dir="auto">DheerajHi Akira,
<div dir="auto">Thanks for the reply.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I know it doesn't affect rendering but I am
working on converting text to pdf. So, I need to get the value
of width of each character.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Cheers</div>
<div dir="auto">Dheeraj</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Feb 5, 2020, 2:58 PM
Akira TAGOH <<a href="mailto:akira@tagoh.org" rel="noreferrer noreferrer noreferrer" target="_blank">akira@tagoh.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Feb
5, 2020 at 6:06 PM Dheeraj Yadav <<a href="mailto:dhirajyadav135@gmail.com" rel="noreferrer
noreferrer noreferrer noreferrer" target="_blank">dhirajyadav135@gmail.com</a>>
wrote:<br>
><br>
> Hello everyone,<br>
> The font I am using has FC_SPACING set as PROPORTIONAL.<br>
> So, Width of each character is different. I wanted to
know, is it possible to get width of each character for a
particular font in C i.e. using fontconfig.h ?<br>
<br>
Even if you change a value in FC_SPACING property, that won't
change<br>
the feel of "Width of each character is different" because
that is the<br>
reason why it was PROPORTIONAL. that is just a cache from a
font to<br>
query a best font against a request. that won't affect the
rendering<br>
directly.<br>
<br>
><br>
> Thank you for your time.<br>
><br>
> Cheers<br>
> Dheeraj<br>
> _______________________________________________<br>
> Fontconfig mailing list<br>
> <a href="mailto:Fontconfig@lists.freedesktop.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Fontconfig@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
<br>
<br>
<br>
-- <br>
Akira TAGOH<br>
</blockquote>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Fontconfig mailing list
<a href="mailto:Fontconfig@lists.freedesktop.org" target="_blank" rel="noreferrer">Fontconfig@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/fontconfig</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org" target="_blank" rel="noreferrer">Fontconfig@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
</blockquote></div>