您的位置:

如何优化Ubuntu中文字体设置,提升阅读体验?

一、调整系统字体

Ubuntu系统默认的字体是Liberation Sans,不过该字体显示不够清晰,可以通过修改系统字体的方式提升阅读体验。在Ubuntu系统的Unity桌面下,依次点击System Settings > Appearence > Fonts,可以看到系统使用的字体。

推荐使用以下字体:


Ubuntu字体家族:Ubuntu,Lucida,DejaVu Sans等
文泉驿字体:WenQuanYi,Zen Hei等
中易宋体:SimSun等
思源宋体:Source Han Serif等

可以通过改变字体大小、样式、渲染等属性来调整系统字体的显示效果。

二、安装优化字体

Ubuntu Linux中可以安装Microsoft的字体家族,包括宋体、微软雅黑、楷体等,这些字体是经过微软精心设计的,并且在Windows系统中广泛使用。

可以使用以下命令来安装Microsoft字体:


sudo apt-get install ttf-mscorefonts-installer

该命令会自动下载、安装所有的Microsoft字体,安装完成后,可以在字体选择器中选择使用。

三、替换字体配置文件

可以通过替换Ubuntu字体配置文件的方式来提升字体显示效果,这种方式可以在系统内使用Cleartype的效果来替代系统自带的字体渲染方式。

步骤如下:

  1. 备份原有的字体配置文件:
  2. 
    sudo mv /etc/fonts/conf.d/10-hinting-slight.conf ~
    sudo mv /etc/fonts/conf.d/10-no-sub-pixel.conf ~
    sudo mv /etc/fonts/conf.d/11-lcdfilter-default.conf ~
    
  3. 下载新的字体配置文件:
  4. 
    sudo wget -P /etc/fonts/conf.d/ https://raw.githubusercontent.com/anthonyfok/fonts-conf/master/etc/fonts/conf.d/10-hinting-full.conf
    sudo wget -P /etc/fonts/conf.d/ https://raw.githubusercontent.com/anthonyfok/fonts-conf/master/etc/fonts/conf.d/11-lcdfilter-prefer.conf
    
  5. 更新字体缓存:
  6. 
    sudo fc-cache -f -v
    

四、调整Subpixel渲染方式

Subpixel渲染是一种使用颜色子像素的字体渲染方法,可以提供更好的字体清晰度,不过在不同的显示设备上需要使用不同的Subpixel渲染方式。

可以使用以下命令来调整Subpixel渲染方式:


sudo gedit /etc/profile.d/subpixel.sh

在打开的文件中加入以下命令:


export FREETYPE_PROPERTIES="truetype:interpreter-version=35 cff:no-stem-darkening=1 autofitter:warping=1"

保存文件并退出,然后执行以下命令:


sudo chmod +x /etc/profile.d/subpixel.sh
source /etc/profile.d/subpixel.sh

这样可以在系统启动时自动加载Subpixel渲染方式。

五、优化Chrome浏览器字体

Chrome浏览器默认使用的字体也可以进行优化,提升阅读体验。

可以使用以下命令来修改Chrome浏览器的字体:


sudo gedit /etc/fonts/conf.d/10-google-chrome.conf

在打开的文件中加入以下代码:





   
  
    
    
     
      serif
      
     
    
     
      Ubuntu
      
     
  
    
  
    
    
     
      sans-serif
      
     
    
     
      Ubuntu
      
     
  
    
  
    
    
     
      monospace
      
     
    
     
      Ubuntu Mono
      
     
  
    

   

保存文件并退出,然后执行以下命令:


sudo fc-cache -f -v

这样可以使Chrome浏览器使用Ubuntu字体家族,提升阅读体验。

如何优化Ubuntu中文字体设置,提升阅读体验?

2023-05-16
如何优化网站文本大小,提升用户体验和搜索排名

2023-05-12
优化网站排版,提升阅读体验的技巧

2023-05-12
如何为网站优化字体设置

2023-05-12
CSS 字体属性列表:设定字体与字重,优化网页阅读体验

2023-05-12
优化网页字体风格,提高用户阅读体验

2023-05-13
如何优化网页文字间距以提高阅读体验

2023-05-12
优化网页排版间隔的技巧,提升用户阅读体验

2023-05-12
优化网页文本颜色,提高用户阅读体验

2023-05-12
优化用户阅读体验的文字或图像

2023-05-13
如何优化网页字体样式以提升用户体验

2023-05-12
如何优化网站字体大小,提高用户体验

2023-05-12
提升网站字体优化的技巧

2023-05-12
提升用户体验的Android主题设计

2023-05-14
when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${item.id} [in template "article/detail/index.ftl" at line 48, column 106] ---- Java stack trace (for programmers): ---- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134) at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:370) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104) at freemarker.core.DollarVariable.accept(DollarVariable.java:63) at freemarker.core.Environment.visit(Environment.java:371) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244) at freemarker.core.Environment.visitIteratorBlock(Environment.java:645) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94) at freemarker.core.Environment.visit(Environment.java:335) at freemarker.core.Environment.visit(Environment.java:341) at freemarker.core.Environment.visit(Environment.java:341) at freemarker.core.Environment.process(Environment.java:314) at freemarker.template.Template.process(Template.java:383) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:332) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:266) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:220) at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:181) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1431) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1167) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1106) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at com.software.filter.HttpSpiderIdentifyFilter.doFilter(HttpSpiderIdentifyFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)