NetBurner 3.5.6
PDF Version
qw_fnt_8x16.h
1// qw_fnt_8x16.h
2//
3// This is a library written for SparkFun Qwiic OLED boards that use the SSD1306.
4//
5// SparkFun sells these at its website: www.sparkfun.com
6//
7// Do you like this library? Help support SparkFun. Buy a board!
8//
9// Micro OLED https://www.sparkfun.com/products/14532
10// Transparent OLED https://www.sparkfun.com/products/15173
11// "Narrow" OLED https://www.sparkfun.com/products/17153
12//
13//
14// Written by Kirk Benell @ SparkFun Electronics, March 2022
15//
16// This library configures and draws graphics to OLED boards that use the
17// SSD1306 display hardware. The library only supports I2C.
18//
19// Repository:
20// https://github.com/sparkfun/SparkFun_Qwiic_OLED_Arduino_Library
21//
22// Documentation:
23// https://sparkfun.github.io/SparkFun_Qwiic_OLED_Arduino_Library/
24//
25//
26// SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).
27//
28// SPDX-License-Identifier: MIT
29//
30// The MIT License (MIT)
31//
32// Copyright (c) 2022 SparkFun Electronics
33// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
34// associated documentation files (the "Software"), to deal in the Software without restriction,
35// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
36// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
37// do so, subject to the following conditions:
38// The above copyright notice and this permission notice shall be included in all copies or substantial
39// portions of the Software.
40// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
41// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
42// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
44// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45
46#pragma once
47
48#include "qwiic_resdef.h"
49
50class QwFont8x16 final : public fontSingleton<QwFont8x16> {
51
52public:
53 const uint8_t* data(void)
54 {
55 // include font data (static const), and attribute defines.
56 // Doing this here makes the data variable a static (aka only one instance ever)
57 // variable in this method.
58#include "_fnt_8x16.h"
59
60 return font8x16_data;
61 }
62
63 QwFont8x16()
64 : fontSingleton<QwFont8x16>(FONT_8X16_WIDTH,
65 FONT_8X16_HEIGHT,
66 FONT_8X16_START,
67 FONT_8X16_NCHAR,
68 FONT_8X16_MAP_WIDTH,
69 FONT_8X16_NAME)
70 {
71 }
72};
73
74#define QW_FONT_8X16 QwFont8x16::instance()