Skip to main content
added 429 characters in body
Source Link

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

EDIT: Final code as suggested by Thomas:

<style>body {color: 'black';font-size: `<style>50px;}.label1 {font-family: Tahoma;-webkit-text-stroke: 8px white}</style><span class="label1">Germany</span>

body { color: 'black'; font-size: 50px; } .label1 { font-family: Tahoma; -webkit-text-stroke: 8px white } .label2 { color: black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00; }

.label3 { -webkit-text-stroke: 8px white; } Germany

`

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

EDIT: Final code as suggested by Thomas:

   `<style>

body { color: 'black'; font-size: 50px; } .label1 { font-family: Tahoma; -webkit-text-stroke: 8px white } .label2 { color: black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00; }

.label3 { -webkit-text-stroke: 8px white; } Germany

`

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

EDIT: Final code as suggested by Thomas:

<style>body {color: 'black';font-size: 50px;}.label1 {font-family: Tahoma;-webkit-text-stroke: 8px white}</style><span class="label1">Germany</span>
added 429 characters in body
Source Link

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

How do I set the specific font "MS Shell Dlg 2" with aEDIT: Final code as suggested by Thomas:

   `<style>

body { color: 'black'; font-size: 50px; } .label1 { font-family: Tahoma; -webkit-text-stroke: 8px white halo? } .label2 { color: black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00; }

.label3 { -webkit-text-stroke: 8px white; } Germany

`

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

EDIT: Final code as suggested by Thomas:

   `<style>

body { color: 'black'; font-size: 50px; } .label1 { font-family: Tahoma; -webkit-text-stroke: 8px white } .label2 { color: black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00; }

.label3 { -webkit-text-stroke: 8px white; } Germany

`

Post Reopened by TomazicM, MrXsquared, PolyGeo
clear focus on one question, changed heading
Source Link

Set specific font Add halo to label in QGIS print composer with a specific font (using HTML)

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

The font dialog has the same specifications for each label, but the fonts look very different. I guess there´s something basic that I don´t grasp (first try with HTML). I´ve played around with font-family=..., but to no avail.

NowHow do I have several questions and am unsure which isset the right one ;)specific font "MS Shell Dlg 2" with a white halo?

  1. How do I stop the code from changing my chosen font?
  2. Or else ... How do I define the font using HTML?
  3. And related to that... How do I find out what the "font family" and font are called?
  4. Lastly: Where do I find information on how to work with HTML in the Print Composer (or elsewhere?)

Set specific font in QGIS with HTML

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

The font dialog has the same specifications for each label, but the fonts look very different. I guess there´s something basic that I don´t grasp (first try with HTML). I´ve played around with font-family=..., but to no avail.

Now I have several questions and am unsure which is the right one ;)

  1. How do I stop the code from changing my chosen font?
  2. Or else ... How do I define the font using HTML?
  3. And related to that... How do I find out what the "font family" and font are called?
  4. Lastly: Where do I find information on how to work with HTML in the Print Composer (or elsewhere?)

Add halo to label in QGIS print composer with a specific font (using HTML)

I am using HTML code to buffer a label in QGIS Print Composer, as described in Question 84324.

Sadly, this code also changes the font and I can´t change it back using the font size dialog. I´m not sure what it does, it might just add serifs that I can´t remove, since the font DOES change when I use the font size dialog, but still the output font in the label looks very different from the original "MS Shell Dlg 2" font (compare labels "1 Germany" and "2 and 3 Germany"). I have tried playing around with the code to change the font but couldn´t get the effect I want.

Example of the labels

What I actually want: Label "1 Germany", but with a white buffer and in this exact font (MS Shell Dlg 2, size 24)

Code for Label "2 Germany": <p style="-webkit-text-stroke: 8px white">2 - Germany</p>

Code for Label "3 Germany": <span style="color:black;text-shadow: 0px 0px 2px #4d2d4d, 0px 5px 10px #aefe00;">3 - Germany</span>

How do I set the specific font "MS Shell Dlg 2" with a white halo?

Post Closed as "Needs more focus" by PolyGeo
deleted 41 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
Loading