Skip to content
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

[MiKTeX Portable] fontconfig configs use full path #17

Closed
rend3r opened this issue Oct 5, 2017 · 7 comments
Closed

[MiKTeX Portable] fontconfig configs use full path #17

rend3r opened this issue Oct 5, 2017 · 7 comments
Assignees

Comments

@rend3r
Copy link

rend3r commented Oct 5, 2017

Currently, fonts.conf and localfonts.conf use full path to directories which contains fonts.
For example, my copy of localfonts.conf:

<?xml version="1.0" encoding="UTF-8"?>

<!--
  DO NOT EDIT THIS FILE! It will be replaced when MiKTeX is updated.
  Instead, edit the configuration file localfonts2.conf.
-->

<fontconfig>
<include>localfonts2.conf</include>
<dir>C:\Windows\Fonts</dir>
<dir>C:\Program Files (x86)\Adobe\Acrobat Reader DC\Resource\Font</dir>
<dir>H:\LaTEX\texmfs\install\fonts\type1</dir>
<dir>H:\LaTEX\texmfs\install\fonts\opentype</dir>
</fontconfig>

I use xetex, xetex uses fontconfig for ttf/otf font support. There is no problem until path is not changed, but it's not always true for usb flash drives. Often usb sticks get different drive letter, so full path generated when you update MiKTeX on one machine are not valid for another.
Thus leads for compiling warnings and errors.

Here is "magic" enviroment variables are valid for windows fontconfig build: LOCAL_APPDATA_FONTCONFIG_CACHE, WINDOWSTEMPDIR_FONTCONFIG_CACHE, WINDOWSFONTDIR, FONTCONFIG_FILE but seems they are useless for portable purpose.
I'm not sure, we can use relative path (relative to current directory with configs or something else?) in configs.

@edocevoli
Copy link
Member

The fontconfig files should be regenerated if you start the MiKTeX task bar icon.

@rend3r
Copy link
Author

rend3r commented Oct 7, 2017

You mean "Refresh FNDB" button in MiKTeX Options?

@edocevoli
Copy link
Member

No, I mean the taskbar icon which you get when you run miktex-portable.cmd.

@edocevoli edocevoli added this to the MiKTeX 2.9.6500 milestone Oct 7, 2017
@rend3r
Copy link
Author

rend3r commented Oct 8, 2017

Seems, we talk about the same thing - "MiKTeX Options" is accessible from task bar icon contex menu.
I should mention, I run my custom texstudio.bat

@echo off

REM (  This script should be located on the top of MiKTeX Portable    )
REM (  i.e. in the same directory with miktex-portable.cmd            )

set MIKTEX=%~dp0
set TSX=%MIKTEX%TexStudio

REM (  TeX Directory Structure (TDS) does not specify the location of )
REM (  executable programs. Default MiKTeX binaries:                  )

set MKTX_BIN=%MIKTEX%texmfs\install\miktex\bin

REM (  Path to MiKTeX executables and external programs.              )
REM (  Add more paths here if required. Use semicolon as separator.   )

set path=%MKTX_BIN%;%MIKTEX%tools\gnuplot\bin

REM ( We dont change CWD (%MIKTEX%) and run TexStudio                 )
REM ( All relative paths in the TexStudio options                     )
REM ( should be counted from the CWD                                  )

start "" "%TSX%\texstudio.exe"

As you can see its does not contain miktex-taskbar-icon.exe...
After running MiKTeX task bar icon all absolute paths became valid, at least drive letter has been corrected.
I'm totally fine with this - part of the blame lies on me. See no problem to add miktex-taskbar-icon.exe to the batch.

@rend3r
Copy link
Author

rend3r commented Oct 8, 2017

Could you provide short description what is miktex-taskbar-icon attend to do?

@edocevoli
Copy link
Member

On startup the task-bar icon program runs this command:

initexmf --mkmaps

This will refresh the fontconfig configuration files. I would recommend that you add this command tour your custom batch file.

@rend3r
Copy link
Author

rend3r commented Oct 8, 2017

Thank you for your explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants