Safari font rendering issues

前端 未结 8 826
独厮守ぢ
独厮守ぢ 2020-12-09 02:12

As you can see below, the Texta-Light font in Chrome appears completely different with Safari. Chrome displays the font as I like but Safari\'s rendering on OS X and iOS loo

8条回答
  •  佛祖请我去吃肉
    2020-12-09 02:41

    I found a post which uses JS to adjust the text-stroke property. Here is the actual code:

    $(document).ready(function(){
        is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
        is_explorer = navigator.userAgent.indexOf('MSIE') > -1;
        is_firefox = navigator.userAgent.indexOf('Firefox') > -1;
        is_safari = navigator.userAgent.indexOf("Safari") > -1;
        is_opera = navigator.userAgent.indexOf("Presto") > -1;
        is_mac = (navigator.userAgent.indexOf('Mac OS') != -1);
        is_windows = !is_mac;
    
        if (is_chrome && is_safari){
          is_safari=false;
        }
    
        if (is_safari || is_windows){
          $('body').css('-webkit-text-stroke', '0.5px');
        }
    
    
      });
    

    You can modify the text-stroke of some other element. Hope it helps.

提交回复
热议问题