The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

641 lines
21KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. namespace juce
  20. {
  21. /* This is some quick-and-dirty code to extract the typeface name from a lump of TTF file data.
  22. It's needed because although win32 will happily load a TTF file from in-memory data, it won't
  23. tell you the name of the damned font that it just loaded.. and in order to actually use the font,
  24. you need to know its name!! Anyway, this awful hack seems to work for most fonts.
  25. */
  26. namespace TTFNameExtractor
  27. {
  28. struct OffsetTable
  29. {
  30. uint32 version;
  31. uint16 numTables, searchRange, entrySelector, rangeShift;
  32. };
  33. struct TableDirectory
  34. {
  35. char tag[4];
  36. uint32 checkSum, offset, length;
  37. };
  38. struct NamingTable
  39. {
  40. uint16 formatSelector;
  41. uint16 numberOfNameRecords;
  42. uint16 offsetStartOfStringStorage;
  43. };
  44. struct NameRecord
  45. {
  46. uint16 platformID, encodingID, languageID;
  47. uint16 nameID, stringLength, offsetFromStorageArea;
  48. };
  49. static String parseNameRecord (MemoryInputStream& input, const NameRecord& nameRecord,
  50. const int64 directoryOffset, const int64 offsetOfStringStorage)
  51. {
  52. String result;
  53. auto oldPos = input.getPosition();
  54. input.setPosition (directoryOffset + offsetOfStringStorage + ByteOrder::swapIfLittleEndian (nameRecord.offsetFromStorageArea));
  55. auto stringLength = (int) ByteOrder::swapIfLittleEndian (nameRecord.stringLength);
  56. auto platformID = ByteOrder::swapIfLittleEndian (nameRecord.platformID);
  57. if (platformID == 0 || platformID == 3)
  58. {
  59. auto numChars = stringLength / 2 + 1;
  60. HeapBlock<uint16> buffer;
  61. buffer.calloc (numChars + 1);
  62. input.read (buffer, stringLength);
  63. for (int i = 0; i < numChars; ++i)
  64. buffer[i] = ByteOrder::swapIfLittleEndian (buffer[i]);
  65. static_assert (sizeof (CharPointer_UTF16::CharType) == sizeof (uint16), "Sanity check UTF-16 type");
  66. result = CharPointer_UTF16 ((CharPointer_UTF16::CharType*) buffer.getData());
  67. }
  68. else
  69. {
  70. HeapBlock<char> buffer;
  71. buffer.calloc (stringLength + 1);
  72. input.read (buffer, stringLength);
  73. result = CharPointer_UTF8 (buffer.getData());
  74. }
  75. input.setPosition (oldPos);
  76. return result;
  77. }
  78. static String parseNameTable (MemoryInputStream& input, int64 directoryOffset)
  79. {
  80. input.setPosition (directoryOffset);
  81. NamingTable namingTable = { 0 };
  82. input.read (&namingTable, sizeof (namingTable));
  83. for (int i = 0; i < (int) ByteOrder::swapIfLittleEndian (namingTable.numberOfNameRecords); ++i)
  84. {
  85. NameRecord nameRecord = { 0 };
  86. input.read (&nameRecord, sizeof (nameRecord));
  87. if (ByteOrder::swapIfLittleEndian (nameRecord.nameID) == 4)
  88. {
  89. const String result (parseNameRecord (input, nameRecord, directoryOffset,
  90. ByteOrder::swapIfLittleEndian (namingTable.offsetStartOfStringStorage)));
  91. if (result.isNotEmpty())
  92. return result;
  93. }
  94. }
  95. return {};
  96. }
  97. static String getTypefaceNameFromFile (MemoryInputStream& input)
  98. {
  99. OffsetTable offsetTable = { 0 };
  100. input.read (&offsetTable, sizeof (offsetTable));
  101. for (int i = 0; i < (int) ByteOrder::swapIfLittleEndian (offsetTable.numTables); ++i)
  102. {
  103. TableDirectory tableDirectory;
  104. zerostruct (tableDirectory);
  105. input.read (&tableDirectory, sizeof (tableDirectory));
  106. if (String (tableDirectory.tag, sizeof (tableDirectory.tag)).equalsIgnoreCase ("name"))
  107. return parseNameTable (input, ByteOrder::swapIfLittleEndian (tableDirectory.offset));
  108. }
  109. return {};
  110. }
  111. }
  112. namespace FontEnumerators
  113. {
  114. static int CALLBACK fontEnum2 (ENUMLOGFONTEXW* lpelfe, NEWTEXTMETRICEXW*, int type, LPARAM lParam)
  115. {
  116. if (lpelfe != nullptr && (type & RASTER_FONTTYPE) == 0)
  117. {
  118. const String fontName (lpelfe->elfLogFont.lfFaceName);
  119. ((StringArray*) lParam)->addIfNotAlreadyThere (fontName.removeCharacters ("@"));
  120. }
  121. return 1;
  122. }
  123. static int CALLBACK fontEnum1 (ENUMLOGFONTEXW* lpelfe, NEWTEXTMETRICEXW*, int type, LPARAM lParam)
  124. {
  125. if (lpelfe != nullptr && (type & RASTER_FONTTYPE) == 0)
  126. {
  127. LOGFONTW lf = { 0 };
  128. lf.lfWeight = FW_DONTCARE;
  129. lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
  130. lf.lfQuality = DEFAULT_QUALITY;
  131. lf.lfCharSet = DEFAULT_CHARSET;
  132. lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
  133. lf.lfPitchAndFamily = FF_DONTCARE;
  134. const String fontName (lpelfe->elfLogFont.lfFaceName);
  135. fontName.copyToUTF16 (lf.lfFaceName, sizeof (lf.lfFaceName));
  136. auto dc = CreateCompatibleDC (0);
  137. EnumFontFamiliesEx (dc, &lf, (FONTENUMPROCW) &fontEnum2, lParam, 0);
  138. DeleteDC (dc);
  139. }
  140. return 1;
  141. }
  142. }
  143. StringArray Font::findAllTypefaceNames()
  144. {
  145. StringArray results;
  146. #if JUCE_USE_DIRECTWRITE
  147. SharedResourcePointer<Direct2DFactories> factories;
  148. if (factories->systemFonts != nullptr)
  149. {
  150. ComSmartPtr<IDWriteFontFamily> fontFamily;
  151. uint32 fontFamilyCount = 0;
  152. fontFamilyCount = factories->systemFonts->GetFontFamilyCount();
  153. for (uint32 i = 0; i < fontFamilyCount; ++i)
  154. {
  155. auto hr = factories->systemFonts->GetFontFamily (i, fontFamily.resetAndGetPointerAddress());
  156. if (SUCCEEDED (hr))
  157. results.addIfNotAlreadyThere (getFontFamilyName (fontFamily));
  158. }
  159. }
  160. else
  161. #endif
  162. {
  163. auto dc = CreateCompatibleDC (0);
  164. {
  165. LOGFONTW lf = { 0 };
  166. lf.lfWeight = FW_DONTCARE;
  167. lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
  168. lf.lfQuality = DEFAULT_QUALITY;
  169. lf.lfCharSet = DEFAULT_CHARSET;
  170. lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
  171. lf.lfPitchAndFamily = FF_DONTCARE;
  172. EnumFontFamiliesEx (dc, &lf,
  173. (FONTENUMPROCW) &FontEnumerators::fontEnum1,
  174. (LPARAM) &results, 0);
  175. }
  176. DeleteDC (dc);
  177. }
  178. results.sort (true);
  179. return results;
  180. }
  181. StringArray Font::findAllTypefaceStyles (const String& family)
  182. {
  183. if (FontStyleHelpers::isPlaceholderFamilyName (family))
  184. return findAllTypefaceStyles (FontStyleHelpers::getConcreteFamilyNameFromPlaceholder (family));
  185. StringArray results;
  186. #if JUCE_USE_DIRECTWRITE
  187. SharedResourcePointer<Direct2DFactories> factories;
  188. if (factories->systemFonts != nullptr)
  189. {
  190. BOOL fontFound = false;
  191. uint32 fontIndex = 0;
  192. auto hr = factories->systemFonts->FindFamilyName (family.toWideCharPointer(), &fontIndex, &fontFound);
  193. if (! fontFound)
  194. fontIndex = 0;
  195. // Get the font family using the search results
  196. // Fonts like: Times New Roman, Times New Roman Bold, Times New Roman Italic are all in the same font family
  197. ComSmartPtr<IDWriteFontFamily> fontFamily;
  198. hr = factories->systemFonts->GetFontFamily (fontIndex, fontFamily.resetAndGetPointerAddress());
  199. // Get the font faces
  200. ComSmartPtr<IDWriteFont> dwFont;
  201. uint32 fontFacesCount = 0;
  202. fontFacesCount = fontFamily->GetFontCount();
  203. for (uint32 i = 0; i < fontFacesCount; ++i)
  204. {
  205. hr = fontFamily->GetFont (i, dwFont.resetAndGetPointerAddress());
  206. // Ignore any algorithmically generated bold and oblique styles..
  207. if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
  208. results.addIfNotAlreadyThere (getFontFaceName (dwFont));
  209. }
  210. }
  211. else
  212. #endif
  213. {
  214. results.add ("Regular");
  215. results.add ("Italic");
  216. results.add ("Bold");
  217. results.add ("Bold Italic");
  218. }
  219. return results;
  220. }
  221. extern bool juce_isRunningInWine();
  222. struct DefaultFontNames
  223. {
  224. DefaultFontNames()
  225. {
  226. if (juce_isRunningInWine())
  227. {
  228. // If we're running in Wine, then use fonts that might be available on Linux..
  229. defaultSans = "Bitstream Vera Sans";
  230. defaultSerif = "Bitstream Vera Serif";
  231. defaultFixed = "Bitstream Vera Sans Mono";
  232. }
  233. else
  234. {
  235. defaultSans = "Verdana";
  236. defaultSerif = "Times New Roman";
  237. defaultFixed = "Lucida Console";
  238. defaultFallback = "Tahoma"; // (contains plenty of unicode characters)
  239. }
  240. }
  241. String defaultSans, defaultSerif, defaultFixed, defaultFallback;
  242. };
  243. Typeface::Ptr Font::getDefaultTypefaceForFont (const Font& font)
  244. {
  245. static DefaultFontNames defaultNames;
  246. Font newFont (font);
  247. auto& faceName = font.getTypefaceName();
  248. if (faceName == getDefaultSansSerifFontName()) newFont.setTypefaceName (defaultNames.defaultSans);
  249. else if (faceName == getDefaultSerifFontName()) newFont.setTypefaceName (defaultNames.defaultSerif);
  250. else if (faceName == getDefaultMonospacedFontName()) newFont.setTypefaceName (defaultNames.defaultFixed);
  251. if (font.getTypefaceStyle() == getDefaultStyle())
  252. newFont.setTypefaceStyle ("Regular");
  253. return Typeface::createSystemTypefaceFor (newFont);
  254. }
  255. //==============================================================================
  256. class WindowsTypeface : public Typeface
  257. {
  258. public:
  259. WindowsTypeface (const Font& font) : Typeface (font.getTypefaceName(),
  260. font.getTypefaceStyle())
  261. {
  262. loadFont();
  263. }
  264. WindowsTypeface (const void* data, size_t dataSize)
  265. : Typeface (String(), String())
  266. {
  267. DWORD numInstalled = 0;
  268. memoryFont = AddFontMemResourceEx (const_cast<void*> (data), (DWORD) dataSize,
  269. nullptr, &numInstalled);
  270. MemoryInputStream m (data, dataSize, false);
  271. name = TTFNameExtractor::getTypefaceNameFromFile (m);
  272. loadFont();
  273. }
  274. ~WindowsTypeface()
  275. {
  276. SelectObject (dc, previousFontH); // Replacing the previous font before deleting the DC avoids a warning in BoundsChecker
  277. DeleteDC (dc);
  278. if (fontH != 0)
  279. DeleteObject (fontH);
  280. if (memoryFont != 0)
  281. RemoveFontMemResourceEx (memoryFont);
  282. }
  283. float getAscent() const { return ascent; }
  284. float getDescent() const { return 1.0f - ascent; }
  285. float getHeightToPointsFactor() const { return heightToPointsFactor; }
  286. float getStringWidth (const String& text)
  287. {
  288. auto utf16 = text.toUTF16();
  289. auto numChars = utf16.length();
  290. HeapBlock<uint16> results (numChars);
  291. float x = 0;
  292. if (GetGlyphIndices (dc, utf16, (int) numChars, reinterpret_cast<WORD*> (results.getData()),
  293. GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR)
  294. {
  295. for (size_t i = 0; i < numChars; ++i)
  296. x += getKerning (dc, results[i], (i + 1) < numChars ? results[i + 1] : -1);
  297. }
  298. return x;
  299. }
  300. void getGlyphPositions (const String& text, Array<int>& resultGlyphs, Array<float>& xOffsets)
  301. {
  302. auto utf16 = text.toUTF16();
  303. auto numChars = utf16.length();
  304. HeapBlock<uint16> results (numChars);
  305. float x = 0;
  306. if (GetGlyphIndices (dc, utf16, (int) numChars, reinterpret_cast<WORD*> (results.getData()),
  307. GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR)
  308. {
  309. resultGlyphs.ensureStorageAllocated ((int) numChars);
  310. xOffsets.ensureStorageAllocated ((int) numChars + 1);
  311. for (size_t i = 0; i < numChars; ++i)
  312. {
  313. resultGlyphs.add (results[i]);
  314. xOffsets.add (x);
  315. x += getKerning (dc, results[i], (i + 1) < numChars ? results[i + 1] : -1);
  316. }
  317. }
  318. xOffsets.add (x);
  319. }
  320. bool getOutlineForGlyph (int glyphNumber, Path& glyphPath)
  321. {
  322. if (glyphNumber < 0)
  323. glyphNumber = defaultGlyph;
  324. GLYPHMETRICS gm;
  325. // (although GetGlyphOutline returns a DWORD, it may be -1 on failure, so treat it as signed int..)
  326. auto bufSize = (int) GetGlyphOutline (dc, (UINT) glyphNumber, GGO_NATIVE | GGO_GLYPH_INDEX,
  327. &gm, 0, 0, &identityMatrix);
  328. if (bufSize > 0)
  329. {
  330. HeapBlock<char> data (bufSize);
  331. GetGlyphOutline (dc, (UINT) glyphNumber, GGO_NATIVE | GGO_GLYPH_INDEX, &gm,
  332. bufSize, data, &identityMatrix);
  333. auto pheader = reinterpret_cast<const TTPOLYGONHEADER*> (data.getData());
  334. auto scaleX = 1.0f / tm.tmHeight;
  335. auto scaleY = -scaleX;
  336. while ((char*) pheader < data + bufSize)
  337. {
  338. glyphPath.startNewSubPath (scaleX * pheader->pfxStart.x.value,
  339. scaleY * pheader->pfxStart.y.value);
  340. auto curve = (const TTPOLYCURVE*) ((const char*) pheader + sizeof (TTPOLYGONHEADER));
  341. auto curveEnd = ((const char*) pheader) + pheader->cb;
  342. while ((const char*) curve < curveEnd)
  343. {
  344. if (curve->wType == TT_PRIM_LINE)
  345. {
  346. for (int i = 0; i < curve->cpfx; ++i)
  347. glyphPath.lineTo (scaleX * curve->apfx[i].x.value,
  348. scaleY * curve->apfx[i].y.value);
  349. }
  350. else if (curve->wType == TT_PRIM_QSPLINE)
  351. {
  352. for (int i = 0; i < curve->cpfx - 1; ++i)
  353. {
  354. auto x2 = scaleX * curve->apfx[i].x.value;
  355. auto y2 = scaleY * curve->apfx[i].y.value;
  356. auto x3 = scaleX * curve->apfx[i + 1].x.value;
  357. auto y3 = scaleY * curve->apfx[i + 1].y.value;
  358. if (i < curve->cpfx - 2)
  359. {
  360. x3 = 0.5f * (x2 + x3);
  361. y3 = 0.5f * (y2 + y3);
  362. }
  363. glyphPath.quadraticTo (x2, y2, x3, y3);
  364. }
  365. }
  366. curve = (const TTPOLYCURVE*) &(curve->apfx [curve->cpfx]);
  367. }
  368. pheader = (const TTPOLYGONHEADER*) curve;
  369. glyphPath.closeSubPath();
  370. }
  371. }
  372. return true;
  373. }
  374. private:
  375. static const MAT2 identityMatrix;
  376. HFONT fontH = {};
  377. HGDIOBJ previousFontH = {};
  378. HDC dc { CreateCompatibleDC (0) };
  379. TEXTMETRIC tm;
  380. HANDLE memoryFont = {};
  381. float ascent = 1.0f, heightToPointsFactor = 1.0f;
  382. int defaultGlyph = -1, heightInPoints = 0;
  383. struct KerningPair
  384. {
  385. int glyph1, glyph2;
  386. float kerning;
  387. bool operator== (const KerningPair& other) const noexcept
  388. {
  389. return glyph1 == other.glyph1 && glyph2 == other.glyph2;
  390. }
  391. bool operator< (const KerningPair& other) const noexcept
  392. {
  393. return glyph1 < other.glyph1
  394. || (glyph1 == other.glyph1 && glyph2 < other.glyph2);
  395. }
  396. };
  397. SortedSet<KerningPair> kerningPairs;
  398. void loadFont()
  399. {
  400. SetMapperFlags (dc, 0);
  401. SetMapMode (dc, MM_TEXT);
  402. LOGFONTW lf = { 0 };
  403. lf.lfCharSet = DEFAULT_CHARSET;
  404. lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
  405. lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
  406. lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
  407. lf.lfQuality = PROOF_QUALITY;
  408. lf.lfItalic = (BYTE) (style.contains ("Italic") ? TRUE : FALSE);
  409. lf.lfWeight = style.contains ("Bold") ? FW_BOLD : FW_NORMAL;
  410. lf.lfHeight = -256;
  411. name.copyToUTF16 (lf.lfFaceName, sizeof (lf.lfFaceName));
  412. auto standardSizedFont = CreateFontIndirect (&lf);
  413. if (standardSizedFont != 0)
  414. {
  415. if ((previousFontH = SelectObject (dc, standardSizedFont)) != 0)
  416. {
  417. fontH = standardSizedFont;
  418. OUTLINETEXTMETRIC otm;
  419. if (GetOutlineTextMetrics (dc, sizeof (otm), &otm) != 0)
  420. {
  421. heightInPoints = otm.otmEMSquare;
  422. lf.lfHeight = -(int) heightInPoints;
  423. fontH = CreateFontIndirect (&lf);
  424. SelectObject (dc, fontH);
  425. DeleteObject (standardSizedFont);
  426. }
  427. }
  428. }
  429. if (GetTextMetrics (dc, &tm))
  430. {
  431. auto dpi = (GetDeviceCaps (dc, LOGPIXELSX) + GetDeviceCaps (dc, LOGPIXELSY)) / 2.0f;
  432. heightToPointsFactor = (dpi / GetDeviceCaps (dc, LOGPIXELSY)) * heightInPoints / (float) tm.tmHeight;
  433. ascent = tm.tmAscent / (float) tm.tmHeight;
  434. defaultGlyph = getGlyphForChar (dc, tm.tmDefaultChar);
  435. createKerningPairs (dc, (float) tm.tmHeight);
  436. }
  437. }
  438. void createKerningPairs (HDC hdc, float height)
  439. {
  440. HeapBlock<KERNINGPAIR> rawKerning;
  441. auto numKPs = GetKerningPairs (hdc, 0, 0);
  442. rawKerning.calloc (numKPs);
  443. GetKerningPairs (hdc, numKPs, rawKerning);
  444. kerningPairs.ensureStorageAllocated ((int) numKPs);
  445. for (DWORD i = 0; i < numKPs; ++i)
  446. {
  447. KerningPair kp;
  448. kp.glyph1 = getGlyphForChar (hdc, rawKerning[i].wFirst);
  449. kp.glyph2 = getGlyphForChar (hdc, rawKerning[i].wSecond);
  450. auto standardWidth = getGlyphWidth (hdc, kp.glyph1);
  451. kp.kerning = (standardWidth + rawKerning[i].iKernAmount) / height;
  452. kerningPairs.add (kp);
  453. kp.glyph2 = -1; // add another entry for the standard width version..
  454. kp.kerning = standardWidth / height;
  455. kerningPairs.add (kp);
  456. }
  457. }
  458. static int getGlyphForChar (HDC dc, juce_wchar character)
  459. {
  460. const WCHAR charToTest[] = { (WCHAR) character, 0 };
  461. WORD index = 0;
  462. if (GetGlyphIndices (dc, charToTest, 1, &index, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR
  463. || index == 0xffff)
  464. return -1;
  465. return index;
  466. }
  467. static int getGlyphWidth (HDC dc, int glyphNumber)
  468. {
  469. GLYPHMETRICS gm;
  470. gm.gmCellIncX = 0;
  471. GetGlyphOutline (dc, (UINT) glyphNumber, GGO_NATIVE | GGO_GLYPH_INDEX, &gm, 0, 0, &identityMatrix);
  472. return gm.gmCellIncX;
  473. }
  474. float getKerning (HDC hdc, int glyph1, int glyph2)
  475. {
  476. KerningPair kp;
  477. kp.glyph1 = glyph1;
  478. kp.glyph2 = glyph2;
  479. auto index = kerningPairs.indexOf (kp);
  480. if (index < 0)
  481. {
  482. kp.glyph2 = -1;
  483. index = kerningPairs.indexOf (kp);
  484. if (index < 0)
  485. {
  486. kp.glyph2 = -1;
  487. kp.kerning = getGlyphWidth (hdc, kp.glyph1) / (float) tm.tmHeight;
  488. kerningPairs.add (kp);
  489. return kp.kerning;
  490. }
  491. }
  492. return kerningPairs.getReference (index).kerning;
  493. }
  494. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowsTypeface)
  495. };
  496. const MAT2 WindowsTypeface::identityMatrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } };
  497. Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font)
  498. {
  499. #if JUCE_USE_DIRECTWRITE
  500. SharedResourcePointer<Direct2DFactories> factories;
  501. if (factories->systemFonts != nullptr)
  502. {
  503. std::unique_ptr<WindowsDirectWriteTypeface> wtf (new WindowsDirectWriteTypeface (font, factories->systemFonts));
  504. if (wtf->loadedOk())
  505. return wtf.release();
  506. }
  507. #endif
  508. return new WindowsTypeface (font);
  509. }
  510. Typeface::Ptr Typeface::createSystemTypefaceFor (const void* data, size_t dataSize)
  511. {
  512. return new WindowsTypeface (data, dataSize);
  513. }
  514. void Typeface::scanFolderForFonts (const File&)
  515. {
  516. jassertfalse; // not implemented on this platform
  517. }
  518. } // namespace juce