<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year><year>2021</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxFont</title>
</header>
<module>wxFont</module>
<modulesummary>Functions for wxFont class</modulesummary>
<description><p>A font is an object which determines the appearance of text.
      </p><p>Fonts are used for drawing text to a device context, and setting the appearance of a window's text, see <seemfa marker="wxDC#setFont/2"><c>wxDC:setFont/2</c></seemfa> and <seemfa marker="wxWindow#setFont/2"><c>wxWindow:setFont/2</c></seemfa>.
      </p><p>The easiest way to create a custom font is to use <c>wxFontInfo</c> (not implemented in wx) object to specify the font attributes and then use <seemfa marker="#new/5"><c>new/5</c></seemfa> constructor. Alternatively, you could start with one of the pre-defined fonts or use <seemfa marker="wxWindow#getFont/1"><c>wxWindow:getFont/1</c></seemfa> and modify the font, e.g. by increasing its size using <c>MakeLarger()</c> (not implemented in wx) or changing its weight using <c>MakeBold()</c> (not implemented in wx).
      </p><p>This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.
      </p><p>You can retrieve the current system font settings with <seeerl marker="wxSystemSettings"><c>wxSystemSettings</c></seeerl>.
      </p><p>Predefined objects (include wx.hrl): ?wxNullFont, ?wxNORMAL_FONT, ?wxSMALL_FONT, ?wxITALIC_FONT, ?wxSWISS_FONT
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_font.html#overview_font">Overview font</url>, <seemfa marker="wxDC#setFont/2"><c>wxDC:setFont/2</c></seemfa>, <seemfa marker="wxDC#drawText/3"><c>wxDC:drawText/3</c></seemfa>, <seemfa marker="wxDC#getTextExtent/3"><c>wxDC:getTextExtent/3</c></seemfa>, <seeerl marker="wxFontDialog"><c>wxFontDialog</c></seeerl>, <seeerl marker="wxSystemSettings"><c>wxSystemSettings</c></seeerl>
      </p>
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_font.html">wxFont</url></p>
  </description>
<datatypes><datatype><name name="wxFont"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>Default ctor. </fsummary>
    <desc><p>Default ctor. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
  
    <name name="new" arity="1" clause_i="2" since=""/>
    <fsummary>Copy constructor, uses reference counting. </fsummary>
    <desc><p>Copy constructor, uses reference counting. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="4" clause_i="1" since=""/>
  
    <name name="new" arity="4" clause_i="2" since=""/>
    <fsummary>See: <c>new/5</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="5" clause_i="1" since=""/>
  
    <name name="new" arity="5" clause_i="2" since=""/>
    <fsummary>Creates a font object with the specified attributes and size in pixels. </fsummary>
    <desc><p>Creates a font object with the specified attributes and size in pixels. 
      </p><p>Notice that the use of this constructor is often more verbose and less readable than the use of constructor from <c>wxFontInfo</c> (not implemented in wx), consider using that constructor instead.
      </p><p>Remark: If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used. 
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor. </fsummary>
    <desc><p>Destructor. 
      </p><p>See reference-counted object destruction for more info.
      </p><p>Remark: Although all remaining fonts are deleted when the application exits, the application should try to clean up all fonts itself. This is because wxWidgets cannot know if a pointer to the font object is stored in an application data structure, and there is a risk of double deletion. 
      </p></desc>
  </func>
  
  <func>
    <name name="isFixedWidth" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid. </fsummary>
    <desc><p>Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid. 
      </p><p>Note that this function under some platforms is different from just testing for the font family being equal to <c>wxFONTFAMILY_TELETYPE</c> because native platform-specific functions are used for the check (resulting in a more accurate return value). 
      </p></desc>
  </func>
  
  <func>
    <name name="getDefaultEncoding" arity="0" clause_i="1" since=""/>
    <fsummary>Returns the current application's default encoding. </fsummary>
    <desc><p>Returns the current application's default encoding. 
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_fontencoding.html#overview_fontencoding">Overview fontencoding</url>, <seemfa marker="#setDefaultEncoding/1"><c>setDefaultEncoding/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getFaceName" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the face name associated with the font, or the empty string if there is no face information. </fsummary>
    <desc><p>Returns the face name associated with the font, or the empty string if there is no face information. 
      </p><p>See: <seemfa marker="#setFaceName/2"><c>setFaceName/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getFamily" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the font family if possible. </fsummary>
    <desc><p>Gets the font family if possible. 
      </p><p>As described in ?wxFontFamily docs the returned value acts as a rough, basic classification of the main font properties (look, spacing).
      </p><p>If the current font face name is not recognized by <seeerl marker="wxFont"><c>wxFont</c></seeerl> or by the underlying system, <c>wxFONTFAMILY_DEFAULT</c> is returned.
      </p><p>Note that currently this function is not very precise and so not particularly useful. Font families mostly make sense only for font creation, see <seemfa marker="#setFamily/2"><c>setFamily/2</c></seemfa>.
      </p><p>See: <seemfa marker="#setFamily/2"><c>setFamily/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getNativeFontInfoDesc" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the platform-dependent string completely describing this font. </fsummary>
    <desc><p>Returns the platform-dependent string completely describing this font. 
      </p><p>Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).
      </p><p>Note that the returned string is not meant to be shown or edited by the user: a typical use of this function is for serializing in string-form a <seeerl marker="wxFont"><c>wxFont</c></seeerl> object.
      </p><p>See: <c>SetNativeFontInfo()</c> (not implemented in wx), <seemfa marker="#getNativeFontInfoUserDesc/1"><c>getNativeFontInfoUserDesc/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getNativeFontInfoUserDesc" arity="1" clause_i="1" since=""/>
    <fsummary>Returns a user-friendly string for this font object. </fsummary>
    <desc><p>Returns a user-friendly string for this font object. 
      </p><p>Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).
      </p><p>The string does not encode all <seeerl marker="wxFont"><c>wxFont</c></seeerl> infos under all platforms; e.g. under wxMSW the font family is not present in the returned string.
      </p><p>Some examples of the formats of returned strings (which are platform-dependent) are in <c>SetNativeFontInfoUserDesc()</c> (not implemented in wx).
      </p><p>See: <c>SetNativeFontInfoUserDesc()</c> (not implemented in wx), <seemfa marker="#getNativeFontInfoDesc/1"><c>getNativeFontInfoDesc/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getPointSize" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the point size as an integer number. </fsummary>
    <desc><p>Gets the point size as an integer number. 
      </p><p>This function is kept for compatibility reasons. New code should use <c>GetFractionalPointSize()</c> (not implemented in wx) and support fractional point sizes.
      </p><p>See: <seemfa marker="#setPointSize/2"><c>setPointSize/2</c></seemfa>
      </p><p>See: <c>GetFractionalPointSize()</c> (not implemented in wx)
      </p></desc>
  </func>
  
  <func>
    <name name="getStyle" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the font style. </fsummary>
    <desc><p>Gets the font style. 
      </p><p>See ?wxFontStyle for a list of valid styles.
      </p><p>See: <seemfa marker="#setStyle/2"><c>setStyle/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getUnderlined" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the font is underlined, false otherwise. </fsummary>
    <desc><p>Returns true if the font is underlined, false otherwise. 
      </p><p>See: <seemfa marker="#setUnderlined/2"><c>setUnderlined/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getWeight" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the font weight. </fsummary>
    <desc><p>Gets the font weight. 
      </p><p>See ?wxFontWeight for a list of valid weight identifiers.
      </p><p>See: <seemfa marker="#setWeight/2"><c>setWeight/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="ok" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>isOk/1</c></fsummary>
    <desc><p>See: <seemfa marker="#isOk/1"><c>isOk/1</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="isOk" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if this object is a valid font, false otherwise. </fsummary>
    <desc><p>Returns true if this object is a valid font, false otherwise. 
      </p></desc>
  </func>
  
  <func>
    <name name="setDefaultEncoding" arity="1" clause_i="1" since=""/>
    <fsummary>Sets the default font encoding. </fsummary>
    <desc><p>Sets the default font encoding. 
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_fontencoding.html#overview_fontencoding">Overview fontencoding</url>, <seemfa marker="#getDefaultEncoding/0"><c>getDefaultEncoding/0</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setFaceName" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the facename for the font. </fsummary>
    <desc><p>Sets the facename for the font. 
      </p><p>Remark: To avoid portability problems, don't rely on a specific face, but specify the font family instead (see ?wxFontFamily and <seemfa marker="#setFamily/2"><c>setFamily/2</c></seemfa>).
      </p><p>Return: true if the given face name exists; if the face name doesn't exist in the user's system then the font is invalidated (so that <seemfa marker="#isOk/1"><c>isOk/1</c></seemfa> will return false) and false is returned.
      </p><p>See: <seemfa marker="#getFaceName/1"><c>getFaceName/1</c></seemfa>, <seemfa marker="#setFamily/2"><c>setFamily/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setFamily" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the font family. </fsummary>
    <desc><p>Sets the font family. 
      </p><p>As described in ?wxFontFamily docs the given <c>family</c> value acts as a rough, basic indication of the main font properties (look, spacing).
      </p><p>Note that changing the font family results in changing the font face name.
      </p><p>See: <seemfa marker="#getFamily/1"><c>getFamily/1</c></seemfa>, <seemfa marker="#setFaceName/2"><c>setFaceName/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setPointSize" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the font size in points to an integer value. </fsummary>
    <desc><p>Sets the font size in points to an integer value. 
      </p><p>This is a legacy version of the function only supporting integer point sizes. It can still be used, but to avoid unnecessarily restricting the font size in points to integer values, consider using the new (added in wxWidgets 3.1.2) <c>SetFractionalPointSize()</c> (not implemented in wx) function instead. 
      </p></desc>
  </func>
  
  <func>
    <name name="setStyle" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the font style. </fsummary>
    <desc><p>Sets the font style. 
      </p><p>See: <seemfa marker="#getStyle/1"><c>getStyle/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setUnderlined" arity="2" clause_i="1" since=""/>
    <fsummary>Sets underlining. </fsummary>
    <desc><p>Sets underlining. 
      </p><p>See: <seemfa marker="#getUnderlined/1"><c>getUnderlined/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setWeight" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the font weight. </fsummary>
    <desc><p>Sets the font weight. 
      </p><p>See: <seemfa marker="#getWeight/1"><c>getWeight/1</c></seemfa>
      </p></desc>
  </func>
  </funcs>
</erlref>
