コード例 #1
0
ファイル: entrez.c プロジェクト: hsptools/hsp-wrap
static FonT ChooseAFont (CharPtr param, CharPtr dfault)

{
  FonT  f;
  Char  str [128];

  f = NULL;
  if (GetEntrezAppParam ("FONTS", param, "", str, sizeof (str))) {
    f = ParseFont (str);
  } else {
    /* SetEntrezAppParam ("FONTS", param, dfault); */
    f = ParseFont (dfault);
  }
  return f;
}
コード例 #2
0
ファイル: valdlg.c プロジェクト: hsptools/hsp-wrap
static void SetupCommentSetDialogFont (CommentSetDlgPtr dlg)

{
  if (dlg == NULL) return;

#ifdef WIN_MAC
  dlg->font = ParseFont ("Times,12");
#endif
#ifdef WIN_MSWIN
  dlg->font = ParseFont ("Times New Roman,12");
#endif
#ifdef WIN_MOTIF
  dlg->font = ParseFont ("Times,12");
#endif
}
コード例 #3
0
BOOL CBCGPTagManager::ReadFont (const CString& strValue, LOGFONT& value)
{
	CString strItem;

	if (ExcludeTag (strValue, strItem))
	{
		return ParseFont (strItem, value);
	}

	return FALSE;
}
コード例 #4
0
ファイル: TTC.cpp プロジェクト: huangchuqiang/fontTableTool
bool TTC::Parse(const std::wstring& szFilePath)
{
	Clear();
	m_szFilePath = szFilePath;
	m_pFile = _wfopen(szFilePath.c_str(), L"rb");

	if(NULL==m_pFile)
		return false;

	return ParseFont();
}
コード例 #5
0
    void Font::setFont(const char* psz)
    {
        if (m_pNativeObject)
        {
            ::DeleteObject((HDC)m_pNativeObject);
            m_pNativeObject = nullptr;
        }

        LogfontActions actions;
        ParseFont(psz, actions);
        assert(m_pNativeObject == nullptr);
        fontdesc = psz;
        m_pNativeObject = (void*)CreateFontIndirectA(&actions.m_LogFont);
    }
コード例 #6
0
ファイル: IND_FontManager.cpp プロジェクト: DarthMike/Hydro
/*!
\b Parameters:

\arg \b pNewFont				Pointer to a new object type 1 font.
\arg \b pImage					Pinter to an object ::IND_Image that contains a previously loaded font from a graphic file generated by \b MudFont (see \b tools section).
\arg \b pFile					Name of the configuration file of the font generated by \b MudFont (see \b tools section)
\arg \b pType					Font type (see ::IND_Type)
\arg \b pQuality				Font quality (see ::IND_Quality)

\b Operation:

This function returns 1 (true) if the font object type 1 passed as a parameter 
exists and is added successfully to the manager loading the font directly from
::IND_Image object and a configuration file, both generated with \b MudFont
(modified version for \b IndieLib can be found in the section \b tools).

The posibility of changing the font from an ::IND_Image object is offered in case 
that you want to change the original font with any modification or filter from 
::IND_ImageManager
*/
bool IND_FontManager::Add		(IND_Font		*pNewFont,
								IND_Image		*pImage,
								char			*pFile,
								IND_Type		pType,
								IND_Quality		pQuality)
{
	Debug->Header ("Parsing and loading font", 5);
	Debug->Header ("File name:", 3);
	Debug->DataChar (pFile, 1);

	if (!mOk)
	{	
		WriteMessage ();
		return 0;
	}
	
	// ----- Width and height of the bitmap font MUST be power of two -----

	IND_Math mMath;

	if (!mMath.IsPowerOfTwo (pImage->GetWidth ()) || 
		!mMath.IsPowerOfTwo (pImage->GetHeight ()))
	{
		Debug->Header ("This operation can not be done", 3);
		Debug->DataChar ("", 1);
		Debug->Header ("The height and width of the font must be power of 2", 2);
		return 0;
	}

	// ----- Bitmap (IND_Surface object) creation -----

	IND_Surface *mNewSurface = new IND_Surface;
	if (!mSurfaceManager->Add (mNewSurface, pImage, pType, pQuality)) 
		return 0;

	// IND_Surface object MUST have one block ONLY
	if (mNewSurface->GetNumBlocks() > 1)
	{
		mSurfaceManager->Delete (mNewSurface);
		return 0;
	}

	pNewFont->SetSurface (mNewSurface);

	// ----- XML font parsing -----

	if (!ParseFont (pNewFont, pFile))
	{
		Debug->Header ("Fatal error, cannot load the font xml file", 2);
		return 0;
	}

	pNewFont->SetFileName (pFile);

	// ----- Puts the object into the manager -----

	AddToList (pNewFont);
	
	// ----- Debug -----

	Debug->Header("Font parsed and loaded", 6);	
	
	return 1;
}
コード例 #7
0
ファイル: create.c プロジェクト: thequux/pcb
/* ---------------------------------------------------------------------------
 * parses a file with font information and installs it
 * checks directories given as colon separated list by resource fontPath
 * if the fonts filename doesn't contain a directory component
 */
void
CreateDefaultFont (void)
{
  if (ParseFont (&PCB->Font, Settings.FontFile))
    Message (_("Can't find font-symbol-file '%s'\n"), Settings.FontFile);
}