Skip to content

Prevent missing font #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tychodewaard opened this issue Jul 24, 2018 · 18 comments · Fixed by #64
Closed

Prevent missing font #60

Tychodewaard opened this issue Jul 24, 2018 · 18 comments · Fixed by #64
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@Tychodewaard
Copy link

Tychodewaard commented Jul 24, 2018

Please summarize your question in one sentence

The fonts are missing.

Give a more extended description

In order to deliver themes that customers can relate to, I rename the install zip to customerA. Which results in themes like CustomerA-default, CustomerA-leftmenu etc.
Result is that the fonts are missing cause they are looking for an nvquicktheme folder
So, somewhere in the code it seems to insist on mentioning nvquicktheme :-)

Any way around this?

Other comments or remarks

@Tychodewaard
Copy link
Author

Maybe it's something else...I now renamed the project-details.json and the nvquicktheme folder is now renamed as well. But...the fonts are still not being loaded.

  • I extended the permissions so all necessary file extensions are allowed
  • I even tried uploading the woff2 files directly in the folder. I can see them in the file manager but clicking on them, it gives a 404...

@tksheppard
Copy link
Collaborator

tksheppard commented Jul 27, 2018

The folder the manifest tells DNN to unpack to is based on the project name within project-details.json. Whenever the project is packaged, it should automatically update those references in the manifest. If that's messing up, you can always force it with a gulp manifest command, but please let me know if it's screwing up. Any reference to nvquicktheme should be abolished when the manifest is updated (package.json being the exception).

As for the fonts not being loaded, are the font files making it into the install package? Or is it a disconnect within the CSS somewhere? Upon packaging, any reference to the dist/ directory within template files are automatically removed because the manifest is set to unpack the contents of the dist folder into the theme's root folder within DNN. It is possible some targeting was lost somewhere.

It sounds overall like the packaging went awry, so I'd double check your project-details.json, make sure it's updated, as well as run the gulp package command, then check the install zip to make sure the font files are making it into the zip. If not, please let me know. It's possible there is some gulp funny business going on here.

@Tychodewaard
Copy link
Author

The fonts are making it into the zip. And within the package in the dist.zip
But after uploading into a DNN instance (either 804 or 9.1.1) the fonts are not in the expected folder.
Maybe it is woff2 specific?

@tksheppard
Copy link
Collaborator

tksheppard commented Jul 30, 2018

It shouldn't be woff2 specific as it is setup to zip all files in the dist folder, not specific file types. And I've never had DNN prevent font files from extracting, so this is very puzzling.

Within your manifest.dnn there's a few lines that read like this:

<!-- CSS, Fonts, JS, Images Folder -->
<component type="ResourceFile">
  <resourceFiles>
    <basePath>Portals\_default\Skins\{your project name}\</basePath>
    <resourceFile>
      <name>dist.zip</name>
    </resourceFile>
  </resourceFiles>
</component>

{your project name} should read whatever you have setup in project-details. Does this have the correct path in your manifest.dnn file? Thank you for your patience.

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

When you say that the files aren't in the expected folder, are you verifying that on the file system, or through a browser. You do need to add a MIME type mapping for IIS to serve woff2 files.

@david-poindexter
Copy link
Member

@Tychodewaard - I think @bdukes may have nailed this one - thanks Brian!

@Tychodewaard
Copy link
Author

I think you're right @bdukes ...never crossed my mind that woff2 is not available by default...

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

We have this section in our themes' manifest files:

<component type="Config">
    <config>
        <configFile>web.config</configFile>
        <install>
            <configuration>
                <nodes configfile="web.config">
                    <node path="/configuration/system.webServer" targetpath="/configuration/system.webServer/staticContent" action="update" collision="ignore">
                        <staticContent>
                        </staticContent>
                    </node>
                    <node path="/configuration/system.webServer/staticContent" action="update" key="fileExtension" collision="ignore">
                        <remove fileExtension=".woff" />
                        <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
                        <remove fileExtension=".woff2" />
                        <mimeMap fileExtension=".woff2" mimeType="font/woff2" />
                    </node>
                </nodes>
            </configuration>
        </install>
        <uninstall>
            <configuration>
                <nodes />
            </configuration>
        </uninstall>
    </config>
</component>

@Tychodewaard
Copy link
Author

ok, cool.
I have :



Is yours better?

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

@Tychodewaard I think you missed some formatting, GitHub stripped your example

@Tychodewaard
Copy link
Author

<staticContent> <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /> <remove fileExtension=".woff2" /> <mimeMap fileExtension=".woff2" mimeType="font/woff2" /> </staticContent>

Hope this works better :-)

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

If yours is already in place in the web.config, then that seems fine. What I have just makes sure that's all in place during the theme install.

@david-poindexter david-poindexter self-assigned this Jul 30, 2018
@david-poindexter david-poindexter added question Further information is requested wontfix This will not be worked on labels Jul 30, 2018
@david-poindexter
Copy link
Member

Thanks @bdukes for the assist - we'll go ahead and close this issue.

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

Do you think it makes sense to add that section to the manifest.dnn file?

@david-poindexter
Copy link
Member

@bdukes for those that have the MIME type already configured in IIS, will this manifest addition cause any issues?

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

If the MIME type is configured at the server level (as it is on newer versions of IIS), this will override that configuration (including the the remove element before the mimeMap element ensures there's not a conflict). If it's already defined in the site's web.config (which is what will happen if you configure is in the IIS management UI for the site), this will leave it as is.

@bdukes
Copy link
Contributor

bdukes commented Jul 30, 2018

FYI, looks like the defaults in IIS 10 (at least on my machine) are font/x-woff and application/font-woff2

@david-poindexter
Copy link
Member

@bdukes given that, I do not see any reason why that should not be included. Would you like to submit a PR?

bdukes added a commit to bdukes/nvQuickTheme that referenced this issue Jul 30, 2018
This ensures that the font files which are not mapped by default on older
versions of IIS will be mapped, so that IIS will serve them correctly
(otherwise it will return a 404).  This list is based on the default
mappings in IIS 7 (from https://support.microsoft.com/en-us/help/936496)
and the MIME types are the defaults from an IIS 10 installation.

These additions will override any system-wide defaults set (though they
should match the defaults present in newer servers).  These instructions
will _not_ overwrite any existing mappings in the `web.config` file for
the specific site into which the theme is installed (i.e. if `.woff` has
already been mapped in the site, this won't change that mapping, but if
`.woff2` has not been mapped, that mapping will be added).  Any other
customizations to the `staticContent` section of the `web.config` file
will also be preserved.

Fixes nvisionative#60
@bdukes bdukes mentioned this issue Jul 30, 2018
6 tasks
@david-poindexter david-poindexter added enhancement New feature or request and removed wontfix This will not be worked on labels Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants