<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>System fonts folder</title>
		<link>http://www.allegro.cc/forums/view/610863</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 20 Aug 2012 01:09:36 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi!</p><p>I&#39;m working on Windows XP, so system fonts folder is %WINDIR%/fonts<br />How about other systems?</p><p>I would be very grateful, if someone gave me a path, which, that returns this function:</p><div class="source-code snippet"><div class="inner"><pre>ALLEGRO_PATH <span class="k3">*</span>path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span> ALLEGRO_USER_HOME_PATH <span class="k2">)</span><span class="k2">;</span>
std::string home <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span> path, ALLEGRO_NATIVE_PATH_SEP <span class="k2">)</span><span class="k2">;</span>

path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_path_for_directory"><span class="a">al_create_path_for_directory</span></a><span class="k2">(</span> home.c_str<span class="k2">(</span> <span class="k2">)</span> <span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Specifically, variable path value.<br />And folder with fonts
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:04:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro doesn&#39;t support font folders. Ideally there would be an API like:
</p><div class="source-code snippet"><div class="inner"><pre>q <span class="k3">=</span> al_create_font_query<span class="k2">(</span><span class="s">"sans-serif"</span><span class="k2">)</span><span class="k2">;</span>
<span class="k1">while</span> <span class="k2">(</span><span class="k2">(</span>font_info <span class="k3">=</span> al_find_font<span class="k2">(</span>q<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span>
<span class="k2">{</span>
  <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Font %s lives at %s\n"</span>, font_info-&gt;name, font_info-&gt;path<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
al_destroy_font_query<span class="k2">(</span>q<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
along with helper functions to find or load the font that best matches the query.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 19 Aug 2012 23:14:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If added as an addon I could see it having a function to return an ALLEGRO_FONT and use the system font loader as an option.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 19 Aug 2012 23:20:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I try create this, but i need font folders <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /></p><p>I need only path to system font folders, because i create function, which collect font informations and path to font ( i have an idea ) but i have font folder only for XP
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:21:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I try create this, but i require font folders </p></div></div><p>It would have to be part of that code. It would use platform specific code internally to find the fonts and/or font folders. Ideally you wouldn&#39;t even need the font folders. You&#39;d ask the operating system for fonts, and it would deal with finding them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 19 Aug 2012 23:23:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>But i would only detect font installed in system...</p><p>Only DETECT ( not LOAD )
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:26:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610863/963476#target">CodeStepper</a> said:</div><div class="quote"><p>But i would only detect font installed in system...</p></div></div><p>Right, and the best way to do that would be to ask the OS for the font or a list of fonts, instead of looking in various font folders <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 19 Aug 2012 23:27:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>But i think, my idea is simple...</p><div class="source-code snippet"><div class="inner"><pre>ALLEGRO_PATH <span class="k3">*</span>path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span> ALLEGRO_USER_HOME_PATH <span class="k2">)</span><span class="k2">;</span>
std::string home <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span> path, ALLEGRO_NATIVE_PATH_SEP <span class="k2">)</span><span class="k2">;</span>
home.append<span class="k2">(</span> <span class="s">"..\\..\\WINDOWS\\fonts"</span> <span class="k2">)</span><span class="k2">;</span>

path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_path_for_directory"><span class="a">al_create_path_for_directory</span></a><span class="k2">(</span> home.c_str<span class="k2">(</span> <span class="k2">)</span> <span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

But this is only for xp</p><p>I missunderstand you at this moment... sorry <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:29:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not all systems have a single font folder. For example, I have /home/matthew/.fonts and /usr/share/fonts/ (with many sub folders).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 19 Aug 2012 23:30:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>this from linux?</p><p>But how implement this to detecting font folder, because i have any idea :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:32:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610863/963481#target">CodeStepper</a> said:</div><div class="quote"><p>But how implement this to detecting font folder, because i have any idea :/</p></div></div><p>Instead of detecting the font folder, just find an API (a function) from the OS that lets you get a list of fonts. Like font names and their locations. Maybe even support loading the font directly with this addon (using the OS interfaces) but thats not really all that important.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 19 Aug 2012 23:40:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh, i see now <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /><br />Thank you for help <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Sun, 19 Aug 2012 23:41:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think you&#39;d have to interface with the <a href="http://www.freedesktop.org/wiki/Software/fontconfig">fontconfig</a> library to do a proper job on Linux.</p><p>To write a proper Allegro add-on (or to update the current font add-on), you&#39;d want to take a look at all of the systems Allegro supports and see if there is a common subset of functionality that could be provided across all of them.</p><p>i.e., The goal wouldn&#39;t be to expose all of the features of fontconfig, but to solve the most common use case of querying available fonts.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 19 Aug 2012 23:43:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>On windows:<br /><a href="http://msdn.microsoft.com/en-us/library/dd162620%28v=VS.85%29.aspx">http://msdn.microsoft.com/en-us/library/dd162620%28v=VS.85%29.aspx</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Mon, 20 Aug 2012 00:18:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CodeStepper)</author>
		<pubDate>Mon, 20 Aug 2012 01:09:36 +0000</pubDate>
	</item>
</rss>
