OSDN Git Service

first
[psychlops/cpp.git] / psychlops / platform / win32gl / psychlops_g_font_win32gl.cpp
1 /*
2  *  psychlops_g_font_Win32_GL.h
3  *  Psychlops Standard Library (Universal)
4  *
5  *  Last Modified 2008/09/12 by Kenchi HOSOKAWA
6  *  (C) 2008 Kenchi HOSOKAWA, Kazushi MARUYA and Takao SATO
7  */
8
9 #include "../../core/graphic/psychlops_g_font.h"
10 #include <windows.h>
11
12
13 namespace Psychlops {
14
15         Font Font::default_font(20, normal_weight, normal_style, L"MS UI Gothic");
16
17         std::wstring LocalEncodingtoWCHAR(const char* s, int length) {
18                 std::wstring result;
19                 result.resize( MultiByteToWideChar( CP_ACP, 0, (LPCSTR)s, length, (LPWSTR)result.data(), 0 ) );
20                 MultiByteToWideChar( CP_ACP, 0, (LPCSTR)s, length, (LPWSTR)result.data(), length*2 );
21                 return result;
22         }
23         std::wstring LocalEncodingtoWCHAR(const char* c) {
24                 int i = 0;
25                 while(c[i]!=0) i++;
26                 i--;
27                 return LocalEncodingtoWCHAR(c, i);
28         }
29
30 }       /*      <- namespace Psycholops         */