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

高淳网站建设郑州网站定制

高淳网站建设,郑州网站定制,郑州网站制作怎么样,百度seo效果需求:在11.0 12.0系统定制化开发中,在产品定制中,有产品需求对于系统字体风格不太满意,所以想要更换系统的默认字体,对于系统字体的修改也是常有的功能,而系统默认也支持增加字体,所以就来添加楷…

需求:在11.0 12.0系统定制化开发中,在产品定制中,有产品需求对于系统字体风格不太满意,所以想要更换系统的默认字体,对于系统字体的修改也是常有的功能,而系统默认也支持增加字体,所以就来添加楷体字体为系统字体,并替换为系统默认字体。

  1. 添加系统字体并且设置为默认字体的核心类

frameworks/base/data/fonts/
frameworks/base/data/fonts/fonts.mk
frameworks/base/data/fonts/Android.mk
frameworks/base/data/fonts/fonts.xml 
  1. 添加系统字体并且设置为默认字体核心功能实现和分析

对于系统添加新字体功能,是默认支持的但是有些字体会导致系统的支持性不是太好,所以要选择好系统字体也是比较关键的

具体步骤如下:

2.1fonts下增加新字体

在目录frameworks/base/data/fonts/ 添加 KTFont.ttf

2.2 在frameworks/base/data/fonts/fonts.mk中添加新的字体

具体先看fonts.mk文件

# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# Warning: this is actually a product definition, to be inherited fromPRODUCT_PACKAGES := \DroidSansMono.ttf \AndroidClock.ttf \fonts.xml

增加新字体如下:

PRODUCT_PACKAGES := \DroidSansMono.ttf \AndroidClock.ttf \
+    KTFont.ttf \fonts.xml

2.3 在frameworks/base/data/fonts/Android.mk中添加新的字体

在font_src_files 添加新增的字体格式,如下

 ################################# Build the rest of font files as prebuilt.# $(1): The source file name in LOCAL_PATH.#       It also serves as the module name and the dest file name.define build-one-font-module$(eval include $(CLEAR_VARS))\$(eval LOCAL_MODULE := $(1))\$(eval LOCAL_SRC_FILES := $(1))\$(eval LOCAL_MODULE_CLASS := ETC)\$(eval LOCAL_MODULE_TAGS := optional)\$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\$(eval include $(BUILD_PREBUILT))endef
font_src_files := \AndroidClock.ttf \KTFont.ttf

2.4fonts.xml配置默认字体作为默认系统字体

frameworks/base/data/fonts/fonts.xml 中替换默认字体

先来看下 fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<!--WARNING: Parsing of this file by third-party apps is not supported. Thefile, and the font files it refers to, will be renamed and/or moved outfrom their respective location in the next Android release, and/or theformat or syntax of the file may change significantly. If you parse thisfile for information about system fonts, do it at your own risk. Yourapplication will almost certainly break with the next major Androidrelease.In this file, all fonts without names are added to the default list.Fonts are chosen based on a match: full BCP-47 language tag includingscript, then just language, and finally order (the first font containingthe glyph).Order of appearance is also the tiebreaker for weight matching. This isthe reason why the 900 weights of Roboto precede the 700 weights - weprefer the former when an 800 weight is requested. Since bold spanseffectively add 300 to the weight, this ensures that 900 is the boldpaired with the 500 weight, ensuring adequate contrast.
-->
<familyset version="23"><!-- first font is default --><family name="sans-serif"><font weight="100" style="normal">Roboto-Thin.ttf</font><font weight="100" style="italic">Roboto-ThinItalic.ttf</font><font weight="300" style="normal">Roboto-Light.ttf</font><font weight="300" style="italic">Roboto-LightItalic.ttf</font><font weight="400" style="normal">Roboto-Regular.ttf</font><font weight="400" style="italic">Roboto-Italic.ttf</font><font weight="500" style="normal">Roboto-Medium.ttf</font><font weight="500" style="italic">Roboto-MediumItalic.ttf</font><font weight="900" style="normal">Roboto-Black.ttf</font><font weight="900" style="italic">Roboto-BlackItalic.ttf</font><font weight="700" style="normal">Roboto-Bold.ttf</font><font weight="700" style="italic">Roboto-BoldItalic.ttf</font></family><!-- Note that aliases must come after the fonts they reference. --><alias name="sans-serif-thin" to="sans-serif" weight="100" /><alias name="sans-serif-light" to="sans-serif" weight="300" /><alias name="sans-serif-medium" to="sans-serif" weight="500" /><alias name="sans-serif-black" to="sans-serif" weight="900" /><alias name="arial" to="sans-serif" /><alias name="helvetica" to="sans-serif" /><alias name="tahoma" to="sans-serif" /><alias name="verdana" to="sans-serif" /><family name="sans-serif-condensed"><font weight="300" style="normal">RobotoCondensed-Light.ttf</font><font weight="300" style="italic">RobotoCondensed-LightItalic.ttf</font><font weight="400" style="normal">RobotoCondensed-Regular.ttf</font><font weight="400" style="italic">RobotoCondensed-Italic.ttf</font><font weight="500" style="normal">RobotoCondensed-Medium.ttf</font><font weight="500" style="italic">RobotoCondensed-MediumItalic.ttf</font><font weight="700" style="normal">RobotoCondensed-Bold.ttf</font><font weight="700" style="italic">RobotoCondensed-BoldItalic.ttf</font></family>。。。。。

通过阅读代码发现第一个family 就是默认的字体KTFont.ttf 所以要把添加在一条就行了

所以修改如下:

 <familyset version="23"><!-- first font is default --><family name="sans-serif">
+           <font weight="400" style="normal">KTFont.ttf</font><font weight="100" style="normal">Roboto-Thin.ttf</font><font weight="100" style="italic">Roboto-ThinItalic.ttf</font><font weight="300" style="normal">Roboto-Light.ttf</font><font weight="300" style="italic">Roboto-LightItalic.ttf</font>
-        <font weight="400" style="normal">Roboto-Regular.ttf</font>
+        <!--font weight="400" style="normal">Roboto-Regular.ttf</font--><font weight="400" style="italic">Roboto-Italic.ttf</font><font weight="500" style="normal">Roboto-Medium.ttf</font><font weight="500" style="italic">Roboto-MediumItalic.ttf</font>
@@ -545,10 +546,7 @@<family>

同时注意要注释掉相同属性的 Roboto-Regular.ttf的字体 不然系统会抛异常开不了机

在加载系统默认字体的时候 weight 400的字体已经存在了 所以要注释掉一个即可

http://www.dinnco.com/news/13421.html

相关文章:

  • 工信部网站备案查询验证码错误十大培训机构教育培训机构哪家好
  • wordpress安装配置百度优化是什么
  • 网站开发需要什么设备东莞seo建站优化工具
  • 东莞品牌型网站建设价格百度推广是什么
  • 推荐大良网站建设口碑营销有哪些
  • 哪个公司网站设计好制作网站教学
  • wordpress主题加入html压缩深圳seo公司排名
  • 做网站有哪些程序计算机培训机构哪个最好
  • 自助建站系统步骤数据指数
  • 怎么把wordpress的博客变成题目优化网站的意思
  • 贵阳市网站优化域名申请
  • 武宣县住房和城乡建设局网站外链工厂 外链
  • 滨州网站建设公司一键生成app制作器
  • 网站建设职责举例网络营销的例子
  • 湖南建设银行宣传部网站晋中网站seo
  • 网站想举报怎么做搜索引擎优化的常用方法
  • 网站开发和c语言学技术包分配的培训机构
  • 网站建设公司如何收费网上有免费的网站吗
  • 咋做网站中央新闻直播今天
  • 电脑网站建设规划搜索引擎优化的英文缩写
  • 免费汽车租赁网站模板电话营销技巧和营销方法
  • 软路由系统如何做网站南宁seo推广优化
  • 网站开发属于软件开发类吗东莞做网页建站公司
  • 嘉兴网站建设哪家好seo人才网
  • 免费的制作网站百度推广搜索排名
  • 做网站卖东西赚钱环球军事网最新消息
  • 第五届中国国际进口博览会开幕百度seo排名推广
  • 自己做网站能宣传自己的产品吗怎么可以让百度快速收录视频
  • 公司关于网站建设的通知优化关键词方法
  • 在线网页翻译软件windows优化大师下载