Repository: oppia/oppia

Issue:
Removing un-used fonts directory in third_party/generated.
In `third_party/generated` we have `fonts` which is currently used by `bootstrap-3` only to store `glphyicons` fonts. Earlier it was used by `font-awesome-4` also but after upgrading to`font-awesome-5` now it uses `web_fonts` directory due to change in its directory structure.

After upgrading to bootstrap-4 as don't use glphyicons the fonts directory should be empty considering that no new lib is added which stores data in fonts directory.

if the fonts dir is empty after the migrating to bootstrap-4 it can be removed in the `scripts/build.py` which builds and creates the `third_party/generated folders` and copy/combines all the library files

To learn more about it see the comments in the PR [#6789](https://github.com/oppia/oppia/pull/6789) & in [this doc](https://docs.google.com/document/d/1yBqfSNPwAl3aURxG05CZiosSMbj6jZHts6avcWfDM4A/edit)
First remove the `_generate_copy_tasks_for_fonts` for the fonts folder which excutes in `build_third_party_libs()` of build.py and then remove all the  `FONTS_RELATIVE_DIRECTORY_PATH` & `FONT_DIR` at the needed places and update the `fontspath` in `manifest.json`

This needs good testing for the safe removal of the `fonts` folder, please do check all the console log at places for any 404 error through fonts directory, cross-check manifest.json if there is not library using `fonts` as `fontspath`



Discussion:
@NishealJ Will, you be working on this?
> @NishealJ Will, you be working on this?

raised a PR for the same #7627 thanks!
Hi! i want to contribute and resolve this issue!
@khansaAmrouni Hi, I have assigned you! If you have any questions don't hesitate to ask here.
@vojtechjelinek  thanks! 
so as i understood, we don't need fonts directory anymore, since we migrated to bootstrap 4, 
i changed build.py and manifest files to webfonts, how can i detect if every thing went well , or is there something else i should do to remove fonts directory ?

yes! also after i changed FONTS_RELATED_DIRECTOR_FILE to webfonts in build.py 
and restart the project i got this error, seems that mathJax still needs fonts ? 
[
![Screenshot from 2019-10-17 17-33-24](https://user-images.githubusercontent.com/40694058/67029218-cc399600-f104-11e9-9cdd-4a78c01c3eb4.png)
](url)
@khansaAmrouni This is a totally different error, it is just about the watchers for typescript compiler. The local server should work anyway.

Resolving patch:
diff --git a/scripts/build.py b/scripts/build.py
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -50,11 +50,6 @@
 MINIFIED_THIRD_PARTY_CSS_RELATIVE_FILEPATH = os.path.join(
     'css', 'third_party.min.css')
 
-FONTS_RELATIVE_DIRECTORY_PATH = os.path.join('fonts', '')
-# /webfonts is needed for font-awesome-5, due to changes
-# in its directory structure hence, FAM-5 now doesn't use /fonts
-# but /fonts is needed by BootStrap and will be removed later
-# if /fonts is not used by any other library.
 WEBFONTS_RELATIVE_DIRECTORY_PATH = os.path.join('webfonts', '')
 
 EXTENSIONS_DIRNAMES_TO_DIRPATHS = {
@@ -117,7 +112,6 @@
 # need cache invalidation.
 FILEPATHS_NOT_TO_RENAME = (
     '*.py',
-    'third_party/generated/fonts/*',
     'third_party/generated/js/third_party.min.js.map',
     'third_party/generated/webfonts/*',
     '*.bundle.js',
@@ -588,8 +582,6 @@ def build_third_party_libs(third_party_directory_path):
         third_party_directory_path, THIRD_PARTY_JS_RELATIVE_FILEPATH)
     THIRD_PARTY_CSS_FILEPATH = os.path.join(
         third_party_directory_path, THIRD_PARTY_CSS_RELATIVE_FILEPATH)
-    FONTS_DIR = os.path.join(
-        third_party_directory_path, FONTS_RELATIVE_DIRECTORY_PATH)
     WEBFONTS_DIR = os.path.join(
         third_party_directory_path, WEBFONTS_RELATIVE_DIRECTORY_PATH)
 
@@ -604,11 +596,6 @@ def build_third_party_libs(third_party_directory_path):
         THIRD_PARTY_CSS_FILEPATH, 'w+') as third_party_css_file:
         _join_files(dependency_filepaths['css'], third_party_css_file)
 
-    ensure_directory_exists(FONTS_DIR)
-    _execute_tasks(
-        _generate_copy_tasks_for_fonts(
-            dependency_filepaths['fonts'], FONTS_DIR))
-
     ensure_directory_exists(WEBFONTS_DIR)
     _execute_tasks(
         _generate_copy_tasks_for_fonts(


Test patch: