Files
Microtracking/tools/get_latin_modern.ps1
T

8 lines
575 B
PowerShell

$root = "C:\Users\fdavalos\OneDrive - up.edu.mx\microtracking\MicrotrackingFer\tools\fonts"
$files = Get-ChildItem $root -Recurse -Include *.otf -File | Where-Object { $_.Name -match '10-|12-|8-|9-' } | Select-Object -First 40
foreach ($f in $files) {
$bytes = [IO.File]::ReadAllBytes($f.FullName)
$s = [Text.Encoding]::ASCII.GetString($bytes)
$names = ([regex]::Matches($s, '[ -~]{4,}')) | ForEach-Object { $_.Value } | Where-Object { $_ -match 'Latin' } | Select-Object -Unique
if ($names) { Write-Output ($f.Name + ' => ' + ($names -join ' | ')) }
}