in tikz matrix i'm trying to set row height relatively to the font size, but for that i need to set it as a numeric value instead of names like \normalsize \large... So i use \fontsize, but so far i've only been able to use it through a macro as i need to first, \setlength{\x}{#1} where \x is used like this \fontsize{\x}{\x}. But in \matrix ... how to run \setlength{\x}{#1} before font=\fontsize{...}{...}? my mwe is...
\documentclass[a4paper]{article}
\usepackage[verbose,vmargin=30mm,hmargin=20mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\tikzset{
allmatrix/.style = {matrix of nodes, nodes in empty cells,matrix anchor=north,
row sep=-\pgflinewidth, column sep=-\pgflinewidth},
texttable/.style 2 args={nodes={anchor=center,outer sep=0pt,inner sep=3pt,
text width=#1,text depth=.5ex,text height=#2, font=\fontsize{#2}{#2}}}}
\setlength{\parindent}{0pt}
\begin{document}
\begin{tikzpicture}
\matrix at (0,0) [allmatrix,texttable={60mm}{10pt}] (t1) {
firt line\
second line\
}
\end{tikzpicture}
\end{document}
the macro to be able to use \fontsize is (out of tikz) ...
\newlength\x
\newcommand{\setnumfon}[1]{\setlength\x{#1}\fontsize{\x}{\x}\selectfont}
i don't how to run \setlength in a tikz macro before setting font=\fontsize{\x}{\x}
EDIT: normally we set minimum height= and not text height in tikz matrix. That allows automatic row height adjustment, but actually it also has significant text alignment problem across columns. I have once posted something on this issue, and provided my own solution using text height and text depth. This misalignment is not seen at all in tabular environment with all default settings.

texttable/.style 2 ags, you meant2 args? And the question is quite unclear. You seem to need to transform font names in numbers but nowhere it appears in your code, since you send10ptto yourtexttablemacro. Please be more specific. – SebGlav Feb 28 '22 at 11:15