[Talk-TW] 答复: 答复: 答复: 答复: 答复: 地圖中文字亂碼的问题

Rex Tsai rex.cc.tsai於gmail.com
Wed 3月 19 09:37:08 UTC 2014


修改的部份,稍早都已經回應了

1. 改 cascadenik xml - font config
/etc/mapnik-osm-data/inc/fontset-settings.xml.inc

<FontSet name="book-fonts">
  <Font face-name="DejaVu Sans Book" />
  <Font face-name="unifont Medium" />
</FontSet>

2. 改 /etc/renderd.conf
[mapnik]
plugins_dir=/usr/lib/mapnik/2.0/input
# font_dir=/usr/share/fonts/truetype/ttf-dejavu # 預設
font_dir=/usr/share/fonts/truetype
font_dir_recurse=true

3. 砍掉 mod_tile/renderd cache 重練
sudo rm -rf /var/lib/mod_tile/default/*

Cheers
-Rex



Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 下午5:25 寫道:

> [跑過一次,改了 renderd.conf 可以正常輸出中文。]
>
> 能告訴我你是怎麼配置的嗎?  謝謝
>
>
>
> ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
> *发件人:* Rex Tsai [mailto:rex.cc.tsai at gmail.com]
> *发送时间:* 2014年3月19日 17:15
> *收件人:* Jacarri Chan
> *抄送:* OSM Taiwan
> *主题:* Re: [Talk-TW] 答复: 答复: 答复: 答复: 地圖中文字亂碼的问题
>
>
>
> 我昨天晚上才剛照著[1] Building a tile server from packages<http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/>
> 跑過一次
> 改了 renderd.conf 可以正常輸出中文。
>
> (感覺可以開一場 手搭手架Tile Server 的 Webinar)
>
> [1 ]
> http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/
>
>
>
> Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 下午4:36 寫道:
>
> To All:我已經再一次把系統重裝了。請問大家在ubuntu desktop 12.0.4上安裝這個openstreetmap
> 參考的是下面哪個文檔啊?抑或是還有別的參考文檔?
> The options
>
> 1.    Build a tile server using packages<http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/>
>
> 2.    Build a tile server from source<http://switch2osm.org/serving-tiles/manually-building-a-tile-server/>
>
> 3.    Use an all-in-one solution<http://switch2osm.org/serving-tiles/using-an-all-in-one-solution/>
>
>
>
> To Rex;
>
>         我已經看了renderd的配置文檔,但沒發現有問題.
>
>
>
>
>
> ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
> *发件人:* Rex Tsai [mailto:rex.cc.tsai at gmail.com]
>
> *发送时间:* 2014年3月19日 15:01
>
> *收件人:* Jacarri Chan
> *抄送:* Louis Liu; OSM Taiwan
>
> *主题:* Re: 答复: [Talk-TW] 答复: 答复: 地圖中文字亂碼的问题
>
>
>
> Hi,
>
> Ok, the page[1] suggested you to use renderd. renderd use it's own
> fontpath.
>
> So you need to check your renderd config (/etc/renderd.conf)
>
> [mapnik]
> plugins_dir=/usr/lib/mapnik/2.0/input
> font_dir=/usr/share/fonts/truetype
> font_dir_recurse=true
>
>
> [1]
> http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/
>
> Cheers
>
> -Rex (I'm Rex, not Cheers...Orz)
>
>
>
> Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 下午2:51 寫道:
>
> Hi Cheers:
>
>          $ python -c "import mapnik2;print mapnik2.fontscollectionpath" ,
>
>          我執行了的,得到的結果是”/usr/share/fonts/truetype”,可以從以前發的圖片得到印證.
>
>
>
>
>
>
>
> ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
> *发件人:* Rex Tsai [mailto:rex.cc.tsai at gmail.com]
> *发送时间:* 2014年3月19日 14:47
> *收件人:* Jacarri Chan
> *抄送:* Louis Liu; OSM Taiwan
> *主题:* Re: [Talk-TW] 答复: 答复: 地圖中文字亂碼的问题
>
>
>
> Hi,
>
> You can use the following command to check your font paths.
> $ python -c "import mapnik2;print mapnik2.fontscollectionpath"
>
> Cheers
>
> -Rex
>
>
>
>
>
> Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 下午12:31 寫道:
>
>          我發現它使用的font檔是在/usr/share/fonts/truetype資料夾中。Libreoffice
> 中能找到和樣式表中配置的同種字體。配置好並且系統重啟後,發現還是這樣。
>
>
>
>
>
>
>
>
>
> ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
> *发件人:* Louis Liu [mailto:pttdog at gmail.com]
> *发送时间:* 2014年3月19日 11:05
>
> *收件人:* Jacarri Chan
> *抄送:* OSM Taiwan
>
> *主题:* Re: 答复: [Talk-TW] 地圖中文字亂碼的问题
>
>
>
> Hi Jacarri,
>
> 你下載、匯入的指令是成功的,所以你才會看到地圖出現。
> 你要修改的是 Mapnik (
> 把資料繪製成地圖的工具)的樣式表,這個樣式表決定了地圖繪製的外觀,文字要用什麼字型,字的大小和顏色也是由這個表所決定的。
>
> Cheers,
>
> Louis
>
>
>
> Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 上午10:41 寫道:
>
> Hi Louis:
>
>
>
> 我的OSM data是從這個位址裡面http://download.geofabrik.de/asia/taiwan.html下載的
> taiwan-latest.osm.pbf,然後用這個命令[osm2pgsql --slim -C 1500 --number-processes
> 4 taiwan-latest.osm.pbf]導入進去的,我這樣操作錯了?
>
>
>
>
>
> ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
> *发件人:* Louis Liu [mailto:pttdog at gmail.com]
> *发送时间:* 2014年3月19日 10:24
> *收件人:* Jacarri Chan
> *抄送:* OSM Taiwan
> *主题:* Re: [Talk-TW] 地圖中文字亂碼的问题
>
>
>
> Hi Jacarri,
>
> 你要在 style sheet 裡面設定字型,例如這樣:
>
> <FontSet name="book-fonts">
>   <Font face-name="DejaVu Sans Book" />
>   <Font face-name="unifont Medium" />
> </FontSet>
>
> 然後,Mapnik 所使用的字型檔案要放在特定的路徑內,用下列的指令可以查找到:
>
> python -c "import mapnik;print mapnik.fontscollectionpath"
>
> 繪圖是個頗複雜的事情,加油!
>
> Louis
>
>
>
> Jacarri Chan <jacarrichan at live.com> 於 2014年3月19日 上午10:10 寫道:
>
> Hi
>
> 我按照這個文檔操作時, (
> http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/#<http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/>
> ), 跑起來後發現地圖中文字是亂碼的。 但是資料庫。裡面卻是正常的,請問這個問題怎麼解決啊?
>
>
>
>  ============================================================
>
> Jacarri Chan
>
> ============================================================
>
>
>
>
> _______________________________________________
> Talk-TW mailing list
> Talk-TW at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-tw
>
>
>
>
>
>
> _______________________________________________
> Talk-TW mailing list
> Talk-TW at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-tw
>
>
>
>
>
>
> _______________________________________________
> Talk-TW mailing list
> Talk-TW at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-tw
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-tw/attachments/20140319/6cdf03da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 307173 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk-tw/attachments/20140319/6cdf03da/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 92988 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk-tw/attachments/20140319/6cdf03da/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 808528 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk-tw/attachments/20140319/6cdf03da/attachment-0005.png>


More information about the Talk-TW mailing list