How to get the actual font name from a font file?
Hi
I have only the font Path I have to get the font name from that path. Any idea how to get the actual font name?
Thanks,
I would ask you these questions:
Why do you need to do this? What are you ultimately trying to accomplish?
Are you really asking about the InDesign SDK?
Do you really need to get the "name" of a font from an arbitrary file? Or do you want information about a font installed on the system? If so, what OS?
Do you need to be able to handle any font format?
Which font "name" do you mean?
What language do you want the name in?
(1) It's not clear what you're trying to accomplish. A bit more information about your ultimate goal would be helpful.
(2) This question is not at all specific to the InDesign SDK. Are you really trying to do something in the context of an InDesign plug-in? If so, you probably want to look at IID_IFONTFAMILY and the IFontFamily::GetFamilyName function.
(3) If you are asking more generally, Windows and Mac both have system API calls to get this information, although those tend to deal with installed system fonts, not with arbitrary font files per se.
Also, you can parse the name table from a True Type or Open Type font without using any system APIs; as True Type and Open Type are well-documented standards. I would start by reading these:
The Naming Table
Font Names Table
(4) Although there are other standards, such as Type 1 (PostScript) fonts, and True Type Collection files and other formats, especially on Mac.
(5) Also, when you start down this road, you will quickly realize that your seemingly simple question is actually ambiguous, and that the answer is kind of complicated, because a font can have many names (a family name, a full font name, a style name, a PostScript name, etc.).
(6) And not only does a font have multiple names, it can have each of those names in multiple languages and encodings.
Any clarification would make this a better question.
Similar Messages
-
How to get the Portal Page name from PLSQL?
Can anyone tell me how to get the portal page name from my dynamic page using plsql?
Apparently you can get the page id and work it out from there, but my calls to get the page id are not returning any values anyway.
My code for attempting to get the page id is below.
<oracle>
declare
v_pageid varchar2(30);
begin
v_pageid := wwpro_api_parameters.get_value('_pageid', '/pls/portal30');
htp.print('Page is '|| v_pageid);
end;
</oracle>
Ideally I'd actually just like to get the page name. Is there a straightforward way to do this?
Thanks in advance!
SarahFew clarifications -
1. wwpro_api_parameters cannot be used to get default portal
page parameters such as '_pageid', '_dad', '_schema' etc.,
2. Page information can be obtained through any components which
are available in that particular page. For example, in case of
dynamic page, we need to publish it as a portlet and add it to the
page. This process creates necessary packages in the DB, but we
will not have access to the portlet methods.
So, I would prefer creating a simple DB provider & portlet and access
page title from its show method as follows -
//Declare local variable l_page_id, l_page_title as varchar2
select page_id into l_page_id from wwpob_portlet_instance$ where
portlet_id = p_portlet_record.portlet_id and
provider_id = p_portlet_record.provider_id;
select name into l_page_title from wwpob_page$ where id=l_page_id;
More information on DB provider can be found at
http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.database.providers.html
Secondly, usage of wwpro_api_parameters.get_value method is
incorrect. This method expects two arguments -
<ul>
<li><b>p_name : </b> The name of the parameter to be returned.</li>
<li><b>p_reference_path : </b> An unique identifier for a portlet instance on the current page.</li>
</ul>
p_reference_path would be something like 99_SNOOP_PORTLET_76535103 and not some type of path as its name suggests.
The following code fragment fetches all parameters available
for a portlet.
Note : Copy this code into 'show' method of your portlet.
//Declare l_names, l_values as owa.vc_arr
* Retreive all of the names of parameters for this portlet
l_names := wwpro_api_parameters.get_names(
p_reference_path=>p_portlet_record.reference_path);
* Retreive all of the values of parameters for this portlet
l_values := wwpro_api_parameters.get_values(p_names=>l_names,
p_reference_path=>p_portlet_record.reference_path);
//Loop through these arrays to get parameter information
htp.p('<center><table BORDER COLS=2 WIDTH="90%" >');
htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
htp.tableData(wwui_api_portlet.portlet_heading('Name',1));
htp.tableData(wwui_api_portlet.portlet_heading('Value',1));
htp.tableRowClose;
if l_names.count = 0 then
htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
htp.p('<td COLSPAN="2">'
||wwui_api_portlet.portlet_text(
'No portlet parameters were passed on the URL.',1)
||'</td>');
htp.tableRowClose;
else
for i in 1..l_names.count loop
htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
htp.tableData(l_names(i));
htp.tableData(l_values(i));
htp.tableRowClose;
end loop;
end if;
htp.p('</table></center>');
Hope it helps...
-aMJAD. -
How to get the failover partner name from C++ client
Hi All,
I have configured the mirroring session for my application.
I want to modify the connection string with failover partner name.
Could any one please let me to know how to get the failover partner instance from C++ client dynamically.
Thanks,
Prasad.Are you looking for this?
http://www.connectionstrings.com/sql-server-2012/
http://stackoverflow.com/questions/25534972/auto-failover-multiple-connections-to-mirror-database-when-principal-goes-down -
How to get the pull path name from a file upload window
Hello everyone!
I have encountered the following problem with the following JSP code:
<form method="post" action="filename.jsp">
Upload JAVA program:
<input type=file size=20 name="fname" accept="java">
<input type=submit value="go">
</form>
<%
String s = "";
if (request.getParameter("fname") != null)
s = request.getParameter("fname")
%>
The value of s is alway the filename. However I want to get the full path in addition to the filename, so that I can read the file. Does anyone know how to get the pull name of the file?
thanks a lot in advance,Dear Sir,
thanks a lot for your reply. Please let me explain what I intended to do: I want to upload a file from the local machine and then read the content of the file. Therefore I need to the fullpath of the filename like /var/local/file.java instead of file.java. The latter is what I got.
The problem I have with your code is that the function like "request.getServerScheme()" is not recognized. Maybe is it because I didn't install servelet package? I only installed javax package btw. Also my application runns on Tomcat server if this could give you some information. The error message I had is as follows:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 36 in the jsp file: /addExercise.jsp
Generated servlet error:
[javac] Compiling 1 source file
/usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:133: cannot resolve symbol
symbol : method getServerScheme ()
location: interface javax.servlet.http.HttpServletRequest
url = request.getServerScheme()
^
An error occurred at line: 36 in the jsp file: /addExercise.jsp
Generated servlet error:
/usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:136: cannot resolve symbol
symbol : method getServerScheme ()
location: interface javax.servlet.http.HttpServletRequest
+ ((("http".equals(request.getServerScheme()) && request.getServerPort() != 80)
^
An error occurred at line: 36 in the jsp file: /addExercise.jsp
Generated servlet error:
/usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:137: cannot resolve symbol
symbol : method getServerScheme ()
location: interface javax.servlet.http.HttpServletRequest
||("https".equals(request.getServerScheme()) && request.getServerPort() != 443))
^
An error occurred at line: 36 in the jsp file: /addExercise.jsp
Generated servlet error:
/usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:139: cannot resolve symbol
symbol : method getServletConfig ()
location: interface javax.servlet.http.HttpServletRequest
+ "/" + request.getServletConfig().getServletName()
^
An error occurred at line: 36 in the jsp file: /addExercise.jsp
Generated servlet error:
/usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:140: cannot resolve symbol
symbol : variable path
location: class org.apache.jsp.addExercise_jsp
+ "/" + path
^
5 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856) -
How to get the complete path name when uploading a file from servlet
Hi,
I write a servlet to upload a file from html page
<intput type=file name=fileupload>I am using
import org.apache.commons.fileupload.to upload file. i want to get the all fields in the form and file name and content of the file also.
It give the file name only
String filename= fileItem.getName();
o/p krish.jpgBut i want complete path naem like
d:/krishna/images/funny/krish.jpgI serach the API org.apache.commons.fileupload.*
But i did nt find the method to get it.
plz help me , which api or method to use here..Krishna_Rao_chintu wrote:
But i need path and have to do some calculations on it.No, you don't. If you have requirements which say you do then the requirements are wrong. You couldn't do anything useful with the path on the client system even if you could get it.
is there any alternatives in java
I need path and have to calculate MD5, Presumably you need to calculate MD5 on the contents of the file and not on the name of the file.
and convert the file to binary format.... etc oprations on itSorry, "convert a file to binary format" is basically meaningless.
but we can get the content of the file using
byte [] get()/ getString() methods
If i get content is there any performance degrades?
ie if the content is lengthy is it take more time?Take more time than what? Degrading performance from what? It's certainly true that it would be quicker to not upload the file, but that's a pointless comparison. If you have some other process to compare with, let us know what it would be. -
How to get the total execution time from a tkprof file
Hi,
I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
. The sample of tkprof is given below.
SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
SELECT POSTED_FLAG
FROM
AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 442 0.08 0.13 0 0 0 0
Fetch 963 0.22 4.72 350 16955 0 521
total 1406 0.31 4.85 350 16955 0 521
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 173 (recursive depth: 1)
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
1 1 1 UNION-ALL (cr=38 pr=3 pw=0 time=139 us)
1 1 1 TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
1 1 1 INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20897 us)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
1 1 1 TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
0 0 0 INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
0 0 0 TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 350 0.15 4.33
Disk file operations I/O 3 0.00 0.00
latch: shared pool 1 0.17 0.17
********************************************************************************user13019948 wrote:
Hi,
I have a tkprof file. How can I get the total execution time.
call count cpu elapsed disk query current rows
total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above -
How to get the last data point from a TDM file in LabVIEW?
Hello,
I am using LabVIEW to analyze some rather large TDM files, and I need a way to get only the last data point. So far, the only way I have been able to accomplish this is by reading the entire file. Is there a property in the TDM file or a function in LabVIEW that will allow me to get the index of the last item in a channel?
Thanks!
ChristinaDo you want to avoid reading whole file and want to be able to reach or get the index of last value of channel? is there any specific reason? I am not sure you could do it without loading the whole file. But the easiest way would be just to use array functions "array size" would give you the index of last element.
-Nilesh
Kudos are (always) welcome for the good post. :-) -
How to get customer number and name from the SD document
Hi All,
Can you please let me know how to get Customer Number and Name from the SD Document?
Thanks a lot....
AnilHi,
It will be displayed in the SD (BIlling document) itself, you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
regards,
radhika
Edited by: kolipara radhika on Jul 10, 2009 5:32 AM -
How to get the default selection color from JTable
Hi, there,
I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
Thanks,
-JennyThe windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
http://www.discoverteenergy.com/files/ShowUIDefaults.java
Any of the properties can be changed for the entire application by using:
UIManager.put( "propertyName", value ); -
How to get the actual data in ALV report
I am doing some upgradation work in that i am using Submit & And return and also i am using some function modules like LIST FROM MEMORY , LIST TO TXT wnd WRITE LIST , it gives output in normal list format , But i need to print in ALV report .
With the use of set table for 1st display i got the ALV report but not with actual data, (some junk value is showing) , So can any 1 suggest me how to get the actual data in ALV report, With the use of Any Function Module or with Coding,
with regards,Hi Saravana
I am sure you must be getting the values in tables of table parameters from every FM.
consolidate the values from tables of all FMs in one table and built ALV for that table only.
I hope this way you can show the actual data in ALV.
thanks
Lalit -
How to get the current schema name
Hi,
Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
Thanks
Jogeshok folks, I found the answer at Tom's as usual.
http://asktom.oracle.com/tkyte/who_called_me/index.html
I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
cheers,
paul
create or replace
FUNCTION SELF_EXAM (
p_call_stack VARCHAR2,
p_type VARCHAR2 DEFAULT 'SCHEMA'
) RETURN VARCHAR2
AS
str_stack VARCHAR2(4000);
int_n PLS_INTEGER;
str_line VARCHAR2(255);
found_stack BOOLEAN DEFAULT FALSE;
int_cnt PLS_INTEGER := 0;
str_caller VARCHAR2(30);
str_name VARCHAR2(30);
str_owner VARCHAR2(30);
str_type VARCHAR2(30);
BEGIN
str_stack := p_call_stack;
-- Loop through each line of the call stack
LOOP
int_n := INSTR( str_stack, chr(10) );
EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
-- get the line
str_line := SUBSTR( str_stack, 1, int_n - 1 );
-- remove the line from the stack str
str_stack := substr( str_stack, int_n + 1 );
IF NOT found_stack
THEN
IF str_line like '%handle%number%name%'
THEN
found_stack := TRUE;
END IF;
ELSE
int_cnt := int_cnt + 1;
-- cnt = 1 is ME
-- cnt = 2 is MY Caller
-- cnt = 3 is Their Caller
IF int_cnt = 1
THEN
str_line := SUBSTR( str_line, 22 );
dbms_output.put_line('->' || str_line);
IF str_line LIKE 'pr%'
THEN
int_n := LENGTH('procedure ');
ELSIF str_line LIKE 'fun%'
THEN
int_n := LENGTH('function ');
ELSIF str_line LIKE 'package body%'
THEN
int_n := LENGTH('package body ');
ELSIF str_line LIKE 'pack%'
THEN
int_n := LENGTH('package ');
ELSIF str_line LIKE 'anonymous%'
THEN
int_n := LENGTH('anonymous block ');
ELSE
int_n := null;
END IF;
IF int_n IS NOT NULL
THEN
str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
ELSE
str_type := 'TRIGGER';
END IF;
str_line := SUBSTR( str_line, NVL(int_n,1) );
int_n := INSTR( str_line, '.' );
str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
str_name := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
END IF;
END IF;
END LOOP;
IF UPPER(p_type) = 'NAME'
THEN
RETURN str_name;
ELSIF UPPER(p_type) = 'SCHEMA.NAME'
OR UPPER(p_type) = 'OWNER.NAME'
THEN
RETURN str_owner || '.' || str_name;
ELSIF UPPER(p_type) = 'TYPE'
THEN
RETURN str_type;
ELSE
RETURN str_owner;
END IF;
END SELF_EXAM; -
How to get the report server name in Forms 10g.
How to get the report server name in Forms 10g.
I'm using the Application Server 10g 10.1.2.Hello,
I do not think that you can get this value from anywhere. A solution is to put the Reports server name in an environment variable stored in the /forms/server/default.env file, then to query it at Forms runtime with the TOOL_ENV.Getvar() built-in.
Francois -
How to retrieve the all user name from system domain(including login user)?
Hi, I am trying to get the system domain all users name. But I unable to get the all user name except domain login user name. I used the below code. What I want to do to get the all user name from system domain. Kindly any one help me.
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
String OS = System.getProperty("os.name").toLowerCase();
if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1 ) || (OS.indexOf("windows xp") > -1) )
p = r.exec( "cmd.exe /c set" );
BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null )
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
String domainDNSName = envVars.getProperty("USERDNSDOMAIN");
String userName = envVars.getProperty("USERNAME");
System.out.println("\n\n\n DOMAIN NAME == "+domainDNSName +" USERNAME == "+userName);
Thanks & Regards
PalaniThanks kajbj,
I don't know, How many users in domain. I neet to get all the user names from my domain. User like A, B,C,D, E,F. I need to get this users name.
public class Env {
public static void main(String[] args) {
System.out.println("USERDOMAIN: " + System.getenv("USERDOMAIN"));
System.out.println("USERNAME: " + System.getenv("USERNAME"));
Here , I am getting the login user name only. So i needs all user name. How to retrive or get this.
Regards
Palani -
How to get Driver and url names from a connection pool
Hi,
How to get the DriverName and URL from an existing pool, If I know the name of
connection pool ? Is it possible to know the name of related pool , if I know
the name of datasource?
Thx
Manishhi
there are 2 ways:
url must be: jdbc:weblogic:pool[:connectionPoolID]
or
jdbc:weblogic:jts[:connectionPoolID] (if you want to use jts with your JDBC connection.)
see http://e-docs.bea.com/wls/docs60//javadocs/weblogic/jdbc/pool/Driver.html
However, I think it is safer to configure and use DataSource to get connection.
Nicolas
"kumar" <[email protected]> wrote:
>
Hi,
How to get the DriverName and URL from an existing pool, If I know the name
of
connection pool ? Is it possible to know the name of related pool , if I
know
the name of datasource?
Thx
Manish -
How to get the store procedure name inside this store procedure?
how to get the store procedure name inside this store procedure?
Why cant you get the procedure name as hard code as the proc name is going to change.
Are you looking for getting the parent proc name from child proc name which is getting executed within parent proc?
Try the below:
--Parent Proc
Alter Proc sp_test
as
Begin
Declare @s varbinary(MAX) = Cast('sp_test' as Varbinary(MAX));
SET CONTEXT_INFO @s;
exec sp_test2
End
--Child proc
Alter proc sp_test2
as
SELECT Cast(CONTEXT_INFO() as varchar(100));
--Test execution
Exec sp_test
Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
[Blog]
Maybe you are looking for
-
Image on Phone is small in IOS 7.1
В IOS 7.0.6. при звонке изображение собеседника было на весь экран, в IOS 7.1 изображение собеседника маленькое в углу. Верните обратно функцию картинки собеседника на весь экран, пусть это даже влияет на батарею! Хотя бы сделайте отдельный пункт мен
-
I am unable to restore my previous session after an update to the latest Firefox version.
I was alerted of my available update so I let the update run, came back to the Firefox home page and saw the "Restore previous session" button. I clicked on it and it started to download my update all over again. I tried this again as I thought maybe
-
IPhoto library won't complete upgrade
I recently upgraded to iPhoto 9.3 and when I opened the program, it said that my iPhoto library (1.47GB) needed to be upgraded as well. The blue bar says step 9 of 9 100% complete, but it won't go away and the white spinning icon thing keeps spinning
-
Unable to import table in owb 9.2
i am using warehouse builder 9.2 and database 9i R2 the source databse is also oracle 9i R2 when i create a source module to import the required tabe metadata i found that some table did not apper in the available objects i discovered that for those
-
How to use a project in another project
I am learning Java, Activiti and Vaadin - all at once. I am so new to Java I am not even sure how to ask this question. I have been searching and trying for the last couple of hours. I am following a book on Vaadin. They have example code. It needed