]> granicus.if.org Git - esp-idf/commitdiff
Introduce separate fonts used by blockdiag, sequdiag, actdiag, nwdiag, rackdiag and...
authorKrzysztof <krzychb@gazeta.pl>
Mon, 1 Apr 2019 01:12:08 +0000 (09:12 +0800)
committerKrzysztof <krzychb@gazeta.pl>
Mon, 6 May 2019 05:19:58 +0000 (13:19 +0800)
.gitignore
docs/_static/DejaVuSans.license [deleted file]
docs/_static/DejaVuSans.ttf [deleted file]
docs/conf_common.py
docs/en/conf.py
docs/local_util.py
docs/zh_CN/conf.py

index c5184291984748f1c0bace428d174185b59b8f49..f6b52b9f043198b1b96f2445c3afed7ba3dcecb4 100644 (file)
@@ -36,6 +36,10 @@ docs/*/xml_in/
 docs/*/man/
 docs/doxygen_sqlite3.db
 
+# Downloaded font files
+docs/_static/DejaVuSans.ttf
+docs/_static/NotoSansSC-Regular.otf
+
 # Unit test app files
 tools/unit-test-app/sdkconfig
 tools/unit-test-app/sdkconfig.old
diff --git a/docs/_static/DejaVuSans.license b/docs/_static/DejaVuSans.license
deleted file mode 100644 (file)
index 710b32c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-This package was debianized by Peter Cernak <pce@users.sourceforge.net> on
-Sun,  5 Sep 2004 17:10:26 +0200.
-
-It was downloaded from http://dejavu.sourceforge.net/
-
-Upstream Authors: Stepan Roh <src@users.sourceforge.net> (original author),
-                  see /usr/share/doc/ttf-dejavu/AUTHORS for full list
-
-Copyright:
-
-Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
-
-Bitstream Vera Fonts Copyright
-------------------------------
-
-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
-a trademark of Bitstream, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of the fonts accompanying this license ("Fonts") and associated
-documentation files (the "Font Software"), to reproduce and distribute the
-Font Software, including without limitation the rights to use, copy, merge,
-publish, distribute, and/or sell copies of the Font Software, and to permit
-persons to whom the Font Software is furnished to do so, subject to the
-following conditions:
-
-The above copyright and trademark notices and this permission notice shall
-be included in all copies of one or more of the Font Software typefaces.
-
-The Font Software may be modified, altered, or added to, and in particular
-the designs of glyphs or characters in the Fonts may be modified and
-additional glyphs or characters may be added to the Fonts, only if the fonts
-are renamed to names not containing either the words "Bitstream" or the word
-"Vera".
-
-This License becomes null and void to the extent applicable to Fonts or Font
-Software that has been modified and is distributed under the "Bitstream
-Vera" names.
-
-The Font Software may be sold as part of a larger software package but no
-copy of one or more of the Font Software typefaces may be sold by itself.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
-TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
-FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
-ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
-FONT SOFTWARE.
-
-Except as contained in this notice, the names of Gnome, the Gnome
-Foundation, and Bitstream Inc., shall not be used in advertising or
-otherwise to promote the sale, use or other dealings in this Font Software
-without prior written authorization from the Gnome Foundation or Bitstream
-Inc., respectively. For further information, contact: fonts at gnome dot
-org. 
diff --git a/docs/_static/DejaVuSans.ttf b/docs/_static/DejaVuSans.ttf
deleted file mode 100644 (file)
index 19ed0b4..0000000
Binary files a/docs/_static/DejaVuSans.ttf and /dev/null differ
index fab941cc8814978b0f8ec1702a5eb3d733601971..a008829bdae3d4d8404c3b8fc84f92de8c694029 100644 (file)
@@ -152,14 +152,6 @@ extensions = ['breathe',
               'html_redirects',
               ]
 
-# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
-blockdiag_fontpath = '../_static/DejaVuSans.ttf'
-seqdiag_fontpath = '../_static/DejaVuSans.ttf'
-actdiag_fontpath = '../_static/DejaVuSans.ttf'
-nwdiag_fontpath = '../_static/DejaVuSans.ttf'
-rackdiag_fontpath = '../_static/DejaVuSans.ttf'
-packetdiag_fontpath = '../_static/DejaVuSans.ttf'
-
 # Enabling this fixes cropping of blockdiag edge labels
 seqdiag_antialias = True
 
index 918bf8b0f2abcf9bfd3116a7afb82b29f4a1f8bb..3747c9fc1645170ccc3f14933f1786be216ffa62 100644 (file)
@@ -10,6 +10,7 @@ import sys
 import os
 sys.path.insert(0, os.path.abspath('..'))
 from conf_common import *  # noqa: F401, F403 - need to make available everything from common
+from local_util import download_file  # noqa: E402 - need to import from common folder
 
 # General information about the project.
 project = u'ESP-IDF Programming Guide'
@@ -18,3 +19,15 @@ copyright = u'2016 - 2019, Espressif Systems (Shanghai) CO., LTD'
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 language = 'en'
+
+# Download font file that is stored on a separate server to save on esp-idf repository size.
+print("Downloading font file")
+download_file('https://dl.espressif.com/dl/esp-idf/docs/_static/DejaVuSans.ttf', '../_static')
+
+# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
+blockdiag_fontpath = '../_static/DejaVuSans.ttf'
+seqdiag_fontpath = '../_static/DejaVuSans.ttf'
+actdiag_fontpath = '../_static/DejaVuSans.ttf'
+nwdiag_fontpath = '../_static/DejaVuSans.ttf'
+rackdiag_fontpath = '../_static/DejaVuSans.ttf'
+packetdiag_fontpath = '../_static/DejaVuSans.ttf'
index 666afa9539cafd6d1b4f6c5ac70446f8dde41c2f..2a89592cef3818c86db09efff6d13d7198913f73 100644 (file)
@@ -18,6 +18,7 @@ from __future__ import unicode_literals
 from io import open
 import os
 import shutil
+import urllib
 
 
 def run_cmd_get_output(cmd):
@@ -55,3 +56,11 @@ def copy_if_modified(src_path, dst_path):
             src_file_path = os.path.join(root, src_file_name)
             dst_file_path = os.path.join(dst_path + root[src_path_len:], src_file_name)
             copy_file_if_modified(src_file_path, dst_file_path)
+
+
+def download_file(from_url, to_path):
+    tmp_file, header = urllib.urlretrieve(from_url)
+    filename = os.path.basename(from_url)
+    with open(to_path + "/" + filename, 'wb') as fobj:
+        with open(tmp_file, 'rb') as tmp:
+            fobj.write(tmp.read())
index 6e3c230d83c893ab74ef7112ef7d68caab14d8bf..0ebcc75dd1a0cf30b1fde22a1e11d5fe16c18a65 100644 (file)
@@ -10,6 +10,7 @@ import sys
 import os
 sys.path.insert(0, os.path.abspath('..'))
 from conf_common import *  # noqa: F401, F403 - need to make available everything from common
+from local_util import download_file  # noqa: E402 - need to import from common folder
 
 # General information about the project.
 project = u'ESP-IDF 编程指南'
@@ -18,3 +19,15 @@ copyright = u'2016 - 2019 乐鑫信息科技(上海)股份有限公司'
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 language = 'zh_CN'
+
+# Download font file that is stored on a separate server to save on esp-idf repository size.
+print("Downloading font file")
+download_file('https://dl.espressif.com/dl/esp-idf/docs/_static/NotoSansSC-Regular.otf', '../_static')
+
+# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
+blockdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
+seqdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
+actdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
+nwdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
+rackdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
+packetdiag_fontpath = '../_static/NotoSansSC-Regular.otf'