summaryrefslogtreecommitdiff
path: root/libs/revolution/src/homebuttonLib/nw4hbm/ut/ut_Font.cpp
blob: deb0040be501bb376ff102b5d5b9cd8065864144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Font.h"

#include "../db/assert.h"
#include "CharStrmReader.h"

namespace nw4hbm {
    namespace ut {

        void Font::InitReaderFunc(FontEncoding encoding) {
            NW4HBM_ASSERT_VALID_PTR(43, this);

            switch (encoding) {
            case FONT_ENCODING_UTF8:
                mReaderFunc = &CharStrmReader::ReadNextCharUTF8;
                break;

            case FONT_ENCODING_UTF16:
                mReaderFunc = &CharStrmReader::ReadNextCharUTF16;
                break;

            case FONT_ENCODING_SJIS:
                mReaderFunc = &CharStrmReader::ReadNextCharSJIS;
                break;

            default:
            case FONT_ENCODING_CP1252:
                mReaderFunc = &CharStrmReader::ReadNextCharCP1252;
                break;
            }
        }

    }  // namespace ut
}  // namespace nw4hbm