当前位置: 首页 > news >正文

河北5市最新消息新人学会seo

河北5市最新消息,新人学会seo,做购物网站如何推广,网站制作公司有没有版权使用二进制字体需要将整个字体加载到存储器。 在某些情况下,如果字体很大,如大字号中文字体,则这样做可能不可取。 字体缓存使应用能够从外部存储器只能加载显示字符串所需的字母。 这意味着整个字体无需保存到在可寻址闪存或RAM上&#xff…

使用二进制字体需要将整个字体加载到存储器。 在某些情况下,如果字体很大,如大字号中文字体,则这样做可能不可取。

字体缓存使应用能够从外部存储器只能加载显示字符串所需的字母。 这意味着整个字体无需保存到在可寻址闪存或RAM上,而是只需保存在更大的文件系统上。

字体文件阅读器

FileDataReader.hpp#ifndef FILEDATAREADER_HPP
#define FILEDATAREADER_HPP
#include <fonts/FontCache.hpp>
#include <stdio.h>using namespace touchgfx;class FileDataReader : public FontDataReader
{
public:virtual ~FileDataReader() { }virtual void open(){fp = fopen("generated/fonts/bin/Font_verdana_20_4bpp.bin", "rb");}virtual void close(){fclose(fp);}virtual void setPosition(uint32_t position){fseek(fp, position, SEEK_SET);}virtual void readData(void* out, uint32_t numberOfBytes){fread(out, numberOfBytes, 1, fp);}
private:FILE* fp;
};#endif // FRONTENDAPPLICATION_HPP

创建FontCache、存储缓冲区和文件系统阅读器对象,然后安装CachedFont:

#include <gui/common/FrontendApplication.hpp>
#include <BitmapDatabase.hpp>
#include <texts/TextKeysAndLanguages.hpp>
#include <texts/TypedTextDatabase.hpp>
#include <gui/common/FileDataReader.hpp>
#include <fonts/CachedFont.hpp>
#include <fonts/FontCache.hpp>uint8_t fontdata[5120];
FileDataReader reader;
FontCache fontCache;
CachedFont cachedFont;  //Cached Font objectLOCATION_PRAGMA_NOLOAD("TouchGFX_Cache")
uint16_t Cache[1024 * 604] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Cache");FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap): FrontendApplicationBase(m, heap)
{
#ifdef SIMULATORconst uint32_t cacheSize = 0x300000; //3 MB, as exampleuint16_t* const cacheStartAddr = (uint16_t*)malloc(cacheSize);Bitmap::setCache(cacheStartAddr, cacheSize, 4);
#elseBitmap::setCache(Cache, sizeof(Cache));
#endif//setup the font cache with buffer and size; and file reader objectfontCache.setMemory(fontdata, sizeof(fontdata));fontCache.setReader(&reader);TypedText text = TypedText(T___SINGLEUSE_2OJQ);fontCache.initializeCachedFont(text, &cachedFont);//replace the linked in font in TouchGFX with cachedFontTypedTextDatabase::setFont(Typography::DEFAULT, &cachedFont);Unicode::UnicodeChar* str = const_cast<Unicode::UnicodeChar*>(text.getText());fontCache.cacheString(text, str);
}

运行模拟器

http://www.wooajung.com/news/28212.html

相关文章:

  • 阿里云网站主体变更怎么做产品推广朋友圈文案
  • 网站开发入哪个会计科目百度指数的搜索指数代表什么
  • 怎样利用网站做淘宝客近两年网络营销成功案例
  • 怎么自己做wordpress主题seo顾问服
  • 建设银行信用卡积分兑换网站企业网络推广技巧
  • 如何做招聘网站的对比app拉新推广赚佣金
  • 线上推广工作是做什么的搜索排名优化软件
  • 浙江 网站建设seo自学网官方
  • 做app网站设计软文营销范文
  • 为什么有人做商城优惠券网站卖关键词优化软件有哪些
  • 外贸在线网站建站网络营销发展现状与趋势
  • 做招聘信息的网站有哪些微信朋友圈广告如何投放
  • wordpress国内外贸主题深圳谷歌优化seo
  • 上海大型网站制作公苏州seo关键词排名
  • 开设公司网站网页开发流程
  • 手机网站建设哪家便宜刚刚发生了一件大事
  • python创建网站114网址大全
  • 太原网站制作哪家不错百度指数
  • 开发小程序商城多少钱seo手机端优化
  • 永春县建设局网站免费发帖论坛大全
  • 机器ip后面加个端口做网站做优化的网站
  • 深圳网站有哪些内容游戏优化是什么意思
  • 美国站点网站怎么做常州seo博客
  • wordpress分类没有文章seo实战密码第四版pdf
  • 查看网站被恶意镜像网推是干什么的
  • 公司设计网站费用百度公司简介介绍
  • h5在哪个网站上做石家庄百度关键词搜索
  • 郑州网站建设如何宁波seo网站排名优化公司
  • 一台服务器如何做两个网站查排名的软件有哪些
  • 自己做的网站某些电脑打不开公司网站如何seo