javascript - SVG字體在低版本chrome和移動(dòng)端的縮放問(wèn)題。
問(wèn)題描述
在360極速等低版本殼瀏覽器和移動(dòng)端瀏覽器中,svg中<tspan>標(biāo)簽中的字體無(wú)法正確縮放,在最新版本Chrome中正常。
<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <style>tspan{ display: block;} </style></head><body><p> <svg viewBox='0,0,1000,1000' version='1.1' xmlns='http://www.w3.org/2000/svg'><text><tspan y='55.9' x='5.5'>After all the articles, ads, fliers, etc. have been prepared for the newsletter, the document should be assembled and may require </tspan></text> </svg></p></body></html>
當(dāng)窗口縮小時(shí),極速瀏覽器中字體大小縮放到12px就不會(huì)縮小了。最新chrome中正常。如果打開(kāi)360極速的調(diào)試工具,把display:block屬性去掉就正常縮放了。但直接在css中設(shè)置display:inline也不行。好奇怪。
問(wèn)題解答
回答1:只要給svg設(shè)置樣式 text-rendering='geometricPrecision' 就好了。
相關(guān)文章:
1. Android控件和傳值跳轉(zhuǎn)問(wèn)題2. 百度地圖api - Android 百度地圖點(diǎn)擊線路圖的問(wèn)題?3. vue-resource獲取不到本地json文件的數(shù)據(jù)?4. 老師的這種訪問(wèn)方式為什么我這里打不開(kāi)呢5. npm鏡像站全新上線6. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問(wèn)題。7. 請(qǐng)問(wèn)是對(duì)象還是數(shù)組8. 問(wèn)一下代碼哪里出錯(cuò)了????9. 輸入地址報(bào)以下截圖錯(cuò)誤,怎么辦?10. 模糊查詢實(shí)現(xiàn)一種排序
