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

特产网站设计六色网站

特产网站设计,六色网站,手机网站商城建设答辩,做的网站为什么图片看不了怎么办uniapp vue3 使用 鸿蒙开源字体 我的需求是全局使用鸿蒙字体。 所以#xff1a; 0. 首先下载鸿蒙字体#xff1a; 鸿蒙资源 下载后解压#xff0c;发现里面有几个文件夹#xff1a; 字体名称说明Sans默认的鸿蒙字体#xff0c;支持基本的多语言字符#xff08;包括字…uniapp vue3 使用 鸿蒙开源字体 我的需求是全局使用鸿蒙字体。 所以 0. 首先下载鸿蒙字体 鸿蒙资源 下载后解压发现里面有几个文件夹 字体名称说明Sans默认的鸿蒙字体支持基本的多语言字符包括字母、数字和部分中文。Sans_SC鸿蒙字体的简体中文版本专门优化了简体中文字形。Sans_TC鸿蒙字体的繁体中文版本专门优化了繁体中文字形。Sans_Italic鸿蒙字体的斜体版本适用于字母和数字的斜体显示。Sans_Condensed鸿蒙字体的压缩版本适用于需要紧凑排版的场景。Sans_Condensed_Italic鸿蒙字体的压缩斜体版本适用于需要紧凑排版且斜体显示的场景。Sans_Naskh_Arabic鸿蒙字体的阿拉伯语版本专门优化了阿拉伯语字形。Sans_Naskh_Arabic_UI鸿蒙字体的阿拉伯语 UI 版本适用于用户界面的阿拉伯语显示。 如果你需要支持 简体中文 和 字母数字应该使用以下字体 HarmonyOS_Sans_SC.ttf这是鸿蒙字体的简体中文版本专门优化了简体中文字形同时支持字母和数字。 1. 把字体文件放入目录 2. 写入App.vue script export default {onLaunch: function () {// console.log(App Launch)const fonts [{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Thin.ttf, weight: 100 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Light.ttf, weight: 300 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Regular.ttf, weight: 400 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Medium.ttf, weight: 500 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Bold.ttf, weight: 700 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Black.ttf, weight: 900 },]fonts.forEach(font {uni.loadFontFace({family: font.name,source: url(${font.path}),weight: font.weight.toString(),success: () {console.log(字体 ${font.name} (${font.weight}) 加载成功)},fail: (err) {console.error(字体 ${font.name} (${font.weight}) 加载失败, err)}})})},onShow: function () {// console.log(App Show)},onHide: function () {// console.log(App Hide)} } /scriptstyle langscss /* 引入 uview-plus 和 uni-scss */ import uview-plus/index.scss; import uni_modules/uni-scss/index.scss;/* 引入鸿蒙字体的多字重 */ font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Thin.ttf) format(truetype);font-weight: 100; /* Thin */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Light.ttf) format(truetype);font-weight: 300; /* Light */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Regular.ttf) format(truetype);font-weight: 400; /* Regular */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Medium.ttf) format(truetype);font-weight: 500; /* Medium */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Bold.ttf) format(truetype);font-weight: 700; /* Bold */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Black.ttf) format(truetype);font-weight: 900; /* Black */ }/* 设置全局字体 */ page {font-family: HarmonyOS Sans, sans-serif;font-weight: 500; /* 默认使用 Medium字重 */background-color: #edf0f4; /* 页面背景色 */ }/* 设置 uview-plus 组件的默认字体 */ .u-page {font-family: HarmonyOS Sans, sans-serif; } /style预加载字体可选 为了确保字体加载成功可以在 onLaunch 生命周期中使用 uni.loadFontFace 预加载字体。 script export default {onLaunch: function () {// console.log(App Launch)const fonts [{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Thin.ttf, weight: 100 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Light.ttf, weight: 300 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Regular.ttf, weight: 400 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Medium.ttf, weight: 500 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Bold.ttf, weight: 700 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Black.ttf, weight: 900 },]fonts.forEach(font {uni.loadFontFace({family: font.name,source: url(${font.path}),weight: font.weight.toString(),success: () {console.log(字体 ${font.name} (${font.weight}) 加载成功)},fail: (err) {console.error(字体 ${font.name} (${font.weight}) 加载失败, err)}})})},onShow: function () {// console.log(App Show)},onHide: function () {// console.log(App Hide)} } /script也可以在页面中使用字体 在具体的页面中你可以直接使用 font-family: ‘HarmonyOS Sans SC’ 来应用字体。 templateview classcontainertext classtext这是一段测试文本简体中文/texttext classtextHello, 123456/text/view /templatescript setup // 页面逻辑 /scriptstyle scoped .container {padding: 20px; }.text {font-family: HarmonyOS Sans SC, sans-serif;font-size: 16px;color: #333; } /style如果要兼容微信小程序 script export default {onLaunch: function () {// 小程序环境动态加载字体// #ifdef MP-WEIXINconst fonts [{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Thin.ttf, weight: 100 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Light.ttf, weight: 300 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Regular.ttf, weight: 400 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Medium.ttf, weight: 500 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Bold.ttf, weight: 700 },{ name: HarmonyOS Sans, path: /static/fonts/HarmonyOS_Sans_SC_Black.ttf, weight: 900 },];fonts.forEach(font {uni.loadFontFace({family: font.name,source: url(${font.path}),weight: font.weight.toString(),success: () {console.log(字体 ${font.name} (${font.weight}) 加载成功);},fail: (err) {console.error(字体 ${font.name} (${font.weight}) 加载失败, err);}});});// #endif},onShow: function () {// console.log(App Show)},onHide: function () {// console.log(App Hide)} } /scriptstyle langscss /* 引入 uview-plus 和 uni-scss */ import uview-plus/index.scss; import uni_modules/uni-scss/index.scss;/* 引入鸿蒙字体的多字重 */ /* H5 环境直接使用 font-face */ /* #ifdef H5 */ font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Thin.ttf) format(truetype);font-weight: 100; /* Thin */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Light.ttf) format(truetype);font-weight: 300; /* Light */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Regular.ttf) format(truetype);font-weight: 400; /* Regular */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Medium.ttf) format(truetype);font-weight: 500; /* Medium */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Bold.ttf) format(truetype);font-weight: 700; /* Bold */ }font-face {font-family: HarmonyOS Sans;src: url(/static/fonts/HarmonyOS_Sans_SC_Black.ttf) format(truetype);font-weight: 900; /* Black */ } /* #endif *//* 设置全局字体 */ page {font-family: HarmonyOS Sans, sans-serif;font-weight: 500; /* 默认使用 Medium 字重 */background-color: #edf0f4; /* 页面背景色 */ }/* 设置 uview-plus 组件的默认字体 */ .u-page {font-family: HarmonyOS Sans, sans-serif; } /style 如果使用网络字体 font-face {font-family: HarmonyOS Sans;src: url(https://your-domain.com/fonts/HarmonyOS_Sans_SC_Regular.ttf) format(truetype);font-weight: 400; }
http://www.w-s-a.com/news/767295/

相关文章:

  • 服务器网站备案做网站公司如何赚钱
  • 怎样进行站点优化荣成市有做网站的吗
  • 合肥建设工会网站芜湖做网站建设公司
  • 玉林市住房和城乡建设局网站网站开发百灵鸟
  • 网站怎么做双机房切换建设部网站2015年第158号
  • 郑州服务设计公司网站色块的网站
  • 网站设计所用到的技术做网站添加mp3
  • 凡科做的微网站怎样连接公众号seo李守洪排名大师
  • 温州网站开发网站的制作东莞寮步伟易达电子厂
  • 北京网站设计制作关键词优化微信小程序开发推广网站建设优化规划书
  • 杭州临平网站建设开发公司将购房款划给总公司的法律责任
  • 广东外贸网站推广分类wordpress
  • 聚美优品网站建设方案商城和营销型网站建设
  • 比较著名的seo网站如何建设网站?
  • 如何做商业网站最火wordpress主题
  • 建设网站需要哪些软硬件条件wordpress文章页标题优化
  • 网站建设功能需求文档wordpress 1g1核1m
  • 学做窗帘要下载哪个网站用户反馈数据分析软件园
  • 宁晋网站建设多少钱产品宣传推广方式有哪些
  • delphi做网站阿里巴巴官网首页登录入口
  • 游戏网站怎么建设新建wordpress模板
  • 网络服务器是指兰州网站seo诊断
  • 怎样做投资理财网站godaddy上传网站
  • 网站建设深圳哪家好世界500强企业招聘网站
  • 如何减少网站建设中的错误温州网站公司哪家好
  • 宜章网站建设北京定制公交网站
  • 怎么让谷歌收录我的网站郑州网站建设更好
  • 在线视频网站开发方案phpaspnet网站开发实例视频
  • 正常做一个网站多少钱网站开发所遵循
  • 西部数码网站备份领英创建公司主页