diff --git a/.gitignore b/.gitignore index c51842919..f6b52b9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 710b32c69..000000000 --- a/docs/_static/DejaVuSans.license +++ /dev/null @@ -1,58 +0,0 @@ -This package was debianized by Peter Cernak on -Sun, 5 Sep 2004 17:10:26 +0200. - -It was downloaded from http://dejavu.sourceforge.net/ - -Upstream Authors: Stepan Roh (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 index 19ed0b468..000000000 Binary files a/docs/_static/DejaVuSans.ttf and /dev/null differ diff --git a/docs/conf_common.py b/docs/conf_common.py index fab941cc8..a008829bd 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -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 diff --git a/docs/en/conf.py b/docs/en/conf.py index 918bf8b0f..3747c9fc1 100644 --- a/docs/en/conf.py +++ b/docs/en/conf.py @@ -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' diff --git a/docs/local_util.py b/docs/local_util.py index 666afa953..2a89592ce 100644 --- a/docs/local_util.py +++ b/docs/local_util.py @@ -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()) diff --git a/docs/zh_CN/conf.py b/docs/zh_CN/conf.py index 6e3c230d8..0ebcc75dd 100644 --- a/docs/zh_CN/conf.py +++ b/docs/zh_CN/conf.py @@ -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'