contour icon indicating copy to clipboard operation
contour copied to clipboard

Hard crash when fontconfig has defined alias for specific font family

Open uspasojevic96 opened this issue 3 years ago • 0 comments
trafficstars

Contour Terminal version

Contour Terminal Emulator 0.3.2-unreleased-master-fde55e6b

Installer source

Github: source code cloned

Operating System

Gentoo

Architecture

x86-64

Other Software

No response

Steps to reproduce

  • Use following fontconfig configuration (either changed mapped fonts or make sure you have them on your system
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
  <its:translateRule selector="/fontconfig/*[not(self::description)]" translate="no"/>
 </its:rules>
 <!-- 
 Artificial oblique for fonts without an italic or oblique version
 -->
 <alias>
  <family>SFMono-Regular</family>
  <prefer>
   <family>SF Mono</family>
  </prefer>
 </alias>
 <alias>
  <family>monospace</family>
  <prefer>
   <family>Ubuntu Mono</family>
  </prefer>
 </alias>
 <alias>
  <family>Liberation Mono</family>
  <prefer>
   <family>Ubuntu Mono</family>
  </prefer>
 </alias>
 <alias>
  <family>Liberation</family>
  <prefer>
   <family>Ubuntu</family>
  </prefer>
 </alias>
 <!--  <alias> -->
 <!--      <family>sans-serif</family> -->
 <!--      <prefer><family>Ubuntu</family> -->
 <!--      </prefer> -->
 <!--  </alias> -->
 <!--  -->
 <!--  <alias> -->
 <!--      <family>Helvetica</family> -->
 <!--      <prefer><family>DejaVu Sans</family> -->
 <!--      </prefer> -->
 <!--  </alias> -->
 <match target="font">
  <!-- check to see if the font is roman -->
  <test name="slant">
   <const>roman</const>
  </test>
  <!-- check to see if the pattern requested non-roman -->
  <test name="slant" target="pattern" compare="not_eq">
   <const>roman</const>
  </test>
  <!-- multiply the matrix to slant the font -->
  <edit name="matrix" mode="assign">
   <times>
    <name>matrix</name>
    <matrix>
     <double>1</double>
     <double>0.2</double>
     <double>0</double>
     <double>1</double>
    </matrix>
   </times>
  </edit>
  <!-- pretend the font is oblique now -->
  <edit name="slant" mode="assign">
   <const>oblique</const>
  </edit>
  <!-- and disable embedded bitmaps for artificial oblique -->
  <edit name="embeddedbitmap" mode="assign">
   <bool>false</bool>
  </edit>
 </match>
 <!--
 Synthetic emboldening for fonts that do not have bold face available
 -->
 <match target="font">
  <!-- check to see if the weight in the font is less than medium which possibly need emboldening -->
  <test name="weight" compare="less_eq">
   <const>medium</const>
  </test>
  <!-- check to see if the pattern requests bold -->
  <test name="weight" target="pattern" compare="more_eq">
   <const>bold</const>
  </test>
  <!--
		  set the embolden flag
		  needed for applications using cairo, e.g. gucharmap, gedit, ...
		-->
  <edit name="embolden" mode="assign">
   <bool>true</bool>
  </edit>
  <!--
		 set weight to bold
		 needed for applications using Xft directly, e.g. Firefox, ...
		-->
  <edit name="weight" mode="assign">
   <const>bold</const>
  </edit>
 </match>
 <match target="font">
  <edit name="rgba" mode="assign">
   <const>vrgb</const>
  </edit>
 </match>
 <match target="font">
  <edit name="hinting" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit name="hintstyle" mode="assign">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit name="lcdfilter" mode="assign">
   <const>lcdlight</const>
  </edit>
 </match>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit name="antialias" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>
  • Use default contour configuration

Expected Behavior

Should load the aliased font family

Actual Behavior

Hard crashes with lovely stack trace

Contour version: 0.3.2-unreleased-master-fde55e6b

Stack Trace:
------------
/home/uros/workspace/contour/src/crispy/StackTrace.cpp:90
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/stl_vector.h:98
/home/uros/workspace/contour/src/contour/ContourApp.cpp:76
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/sstream:1136
0x7f4f0937cb40
0x7f4f093c872c
0x7f4f0937caa2
0x7f4f09367449
/home/uros/workspace/contour/src/contour/CaptureScreen.cpp:89
/home/uros/workspace/contour/src/terminal_renderer/DecorationRenderer.cpp:145
/home/uros/workspace/contour/src/terminal_renderer/DecorationRenderer.cpp:83
/home/uros/workspace/contour/src/terminal_renderer/DecorationRenderer.cpp:68
/home/uros/workspace/contour/src/terminal_renderer/Renderer.cpp:208
/home/uros/workspace/contour/src/terminal_renderer/Renderer.cpp:180
/home/uros/workspace/contour/src/contour/opengl/TerminalWidget.cpp:520
0x7f4f0a891504
0x7f4f0a87272c
/home/uros/workspace/contour/src/contour/opengl/TerminalWidget.cpp:702
0x7f4f0a82e93f
0x7f4f09bfcf78
0x7f4f0a869a6c
0x7f4f0a86e5d3
0x7f4f0a871793
0x7f4f0a86e559
0x7f4f0a86e5ef
0x7f4f0a871793
0x7f4f0a86e559
0x7f4f0a86e5ef
0x7f4f0a871793
/home/uros/workspace/contour/src/contour/ContourGuiApp.cpp:383
/home/uros/workspace/contour/src/contour/ContourGuiApp.cpp:339
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/std_function.h:292
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/std_function.h:590
/home/uros/workspace/contour/src/contour/ContourGuiApp.cpp:67
/home/uros/workspace/contour/src/contour/main.cpp:97
0x7f4f093681ca
0x7f4f09368278
??:?

Additional notes

No response

uspasojevic96 avatar May 07 '22 19:05 uspasojevic96