Skip to content

Include Ubuntu Mono as a shipped font #1325 #1328 #1329 and Add Licencing info. #1332

Closed
satnamiaman wants to merge 2 commits intoMudlet:developmentfrom
satnamiaman:development
Closed

Include Ubuntu Mono as a shipped font #1325 #1328 #1329 and Add Licencing info. #1332
satnamiaman wants to merge 2 commits intoMudlet:developmentfrom
satnamiaman:development

Conversation

@satnamiaman
Copy link
Copy Markdown

-Ubuntu Mono Font Added.
-Ubuntu Licence is added to ui/about_dialog.ui

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Oct 14, 2017

⚠️ Sorry to intrude but can I request a hold on this? Your addition to the about_dialog.ui file will clash badly with #1334 as I have (had) to move the text/HTML out of that file and move it to dlgAboutDialog.cpp - I will help with this if needed but if you have an understanding of simple HTML tags it should be fairly straightforward - I will want two QStrings one containing a translatable header and the other containing a non-translated content of the licence (unless there are official translations in other languages that is).

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 15, 2017

#1334 is a massive PR and will take a really long while to get in - I'd rather have it not create a traffic jam of everything else. I'm not sold on it's proposal of hand-editing Qt's HTML in a raw text editor, that's not tenable going forward :(

I think we should get this in and adjust #1334 as necessary.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 16, 2017

@SlySven thoughts?

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Oct 16, 2017

I am not seeing the change to add these files to the mudlet.qrc resources file and to copy (if they do not exist) these files out of there into the ~/.config/mudlet/fonts/ (returned by mudlet::getMudletPath(mudlet::mainFontsPath) ) or a ubuntu-font-family-0.83 subdirectory.

Indeed, it might be worth making the following change to mudlet::getMudletPath(...) from:

case mainFontsPath:
    // (Added for 3.5.0) a revised location to store Mudlet provided fonts
    return QStringLiteral("%1/.config/mudlet/fonts")
            .arg(QDir::homePath());

to:

case mainFontsPath:
    // (Added for 3.5.0) a revised location to store Mudlet provided fonts -
    // takes one optional extra argument (sub-directory name) that returns
    // the directory for font files supplied with Mudlet - does NOT end in '/'
    // (unless extra1 does)
    if (extra1.isEmpty()) {
        return QStringLiteral("%1/.config/mudlet/fonts")
                .arg(QDir::homePath());
    } else {
        return QStringLiteral("%1/.config/mudlet/fonts/%1")
                .arg(QDir::homePath(), extra1);
    }

however the existing code will handle this as it is if the calls to things like:

checkAndCopyFont(fontDirectory, QLatin1String("VeraSeBd.ttf"));

are extended to include:

QString fontSubDirectory(QStringLiteral("%1/ubuntu-font-family-0.83").arg(fontDirectory));
checkAndCopyFont(fontSubDirectory, QLatin1String("CONTRIBUTING.txt"));
...
checkAndCopyFont(fontSubDirectory, QLatin1String("UbuntuMono-R.ttf"));
...
checkAndCopyFont(fontSubDirectory, QLatin1String("copyright.txt"));

where ... represents the other files to also copy out of the resource file...

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 19, 2017

Good point, @zzbazinga do you think you'll be able to do these changes, or would you like some help and explanation?

@satnamiaman
Copy link
Copy Markdown
Author

@vadi2 It will be very helpful if you provide some explanation.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 19, 2017

For sure. So we added the font files to the source code, but now we also need to do the following:

  1. embed the fonts into Mudlet, so when Mudlet is installed onto a users computer, the fonts will get installed too. To do this, have replicate how the other font is currently done in mudlet.qrc.
  2. extract the embedded font from Mudlet into a directory when Mudlet launches - for this, replicate copyFont calls in main.cpp.

That should be it - if you get stuck, let me know!

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Oct 19, 2017

  1. embed the fonts into Mudlet, so when Mudlet is installed onto a users computer, the fonts will get installed too. To do this, have replicate how the other font is currently done in mudlet.qrc.

Given that you have already put the files in a suitable sub-directory you need to "Add existing files..." to the mudlet.qrc resources file within Qt Creator - this will add each of them to the XML content in that file, but it just adds them in at the bottom so afterwards it is useful to "Open with |>" --> "Plain Text Editor" and reposition the new lines in non-case sorted alphabetical order like the rest (should be)/are in - not essential but makes it easier to track additions/deletions when looking at the Git records of changes...

💡 Hint: the files do not get added to the (binary) resources until the next time you compile (when Qt updates the internally managed qrc_mudlet.cpp and qrc_mudlet.o source and binary output files in the build directory) so you might have to compile the application once before you can see the new files properly in the browser part of the IDE - later versions of Creator are better at hiding this now but in the past it was a little confusing sometimes if you added files and then immediately tried to use/include such added things like icons in the form/dialogue QtDesigner plug-in!

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 27, 2017

@zzbazinga hey, how're you going with this? Can I help with an explanation?

@SlySven SlySven added the On Hold PR on hold pending further discussion or other incident. label Dec 4, 2017
@SlySven SlySven self-assigned this Dec 4, 2017
@SlySven SlySven added this to the 3.7.0 milestone Dec 4, 2017
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Dec 4, 2017

Oh, I was taking a look at this and I can see that the OP has promulgated this PR as his own development branch which means that he cannot easily update his repository to bring in any changes since he started the PR - IMHO he needs to create another branch in his local repository at the same point in the history - and work on that, closing this PR and then putting up a new PR based upon that new branch which only has to persist until it is merged into the development branch here. At the same time he can do a git fetch --all to update the remote entries tracking this and any other forks he is watching and then he can hard reset his development branch to be the same as the one on here...

We will have to make inclusion of this font in the binary as a resource an optional feature because the licence terms are just outside of what Debian at least can consider as "Free" (see here on Wikipedia) - and they will not want to distribute it inside their packages. As it happens they already strip out the Bitstream Vera fonts - but that is because those are available within their packages and there is no need to carry a local copy of them but I will look to include a build option to control the inclusion - which @csmall will hopefully appreciate!

I am putting this "on hold" as a placeholder and will submit a replacement shortly...

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 6, 2017

Superseded by #1446. Thanks for your start on this, @zzbazinga!

@vadi2 vadi2 closed this Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

On Hold PR on hold pending further discussion or other incident.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants